{
 "cells": [
  {
   "cell_type": "markdown",
   "id": "520bca22",
   "metadata": {},
   "source": [
    "# 1-4,时间序列数据建模流程范例"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "914d0791",
   "metadata": {},
   "source": [
    "2020年发生的新冠肺炎疫情灾难给各国人民的生活造成了诸多方面的影响。\n",
    "\n",
    "有的同学是收入上的，有的同学是感情上的，有的同学是心理上的，还有的同学是体重上的。\n",
    "\n",
    "本文基于中国2020年3月之前的疫情数据，建立时间序列RNN模型，对中国的新冠肺炎疫情结束时间进行预测。"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "7fd11a67",
   "metadata": {},
   "source": [
    "![](./data/疫情前后对比.png)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "id": "306f3ae5",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "torch.__version__ =  2.4.0\n"
     ]
    }
   ],
   "source": [
    "import torch \n",
    "print(\"torch.__version__ = \", torch.__version__)\n",
    "\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "73b65b4b",
   "metadata": {},
   "source": [
    "<br>\n",
    "\n",
    "<font color=\"red\">\n",
    " \n",
    "公众号 **算法美食屋** 回复关键词：**pytorch**， 获取本项目源码和所用数据集百度云盘下载链接。\n",
    "    \n",
    "</font> \n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "4d46f9f9",
   "metadata": {},
   "source": [
    "## 一，准备数据"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "4a5acccb",
   "metadata": {},
   "source": [
    "本文的数据集取自tushare，获取该数据集的方法参考了以下文章。\n",
    "\n",
    "《https://zhuanlan.zhihu.com/p/109556102》\n",
    "\n",
    "![](./data/1-4-新增人数.png)\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "id": "738b171a",
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import pandas as pd \n",
    "import matplotlib.pyplot as plt\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "id": "903d0408",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n",
       "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
       "  \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
       "<svg xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"611.2125pt\" height=\"422.886795pt\" viewBox=\"0 0 611.2125 422.886795\" xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\">\n",
       " <metadata>\n",
       "  <rdf:RDF xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n",
       "   <cc:Work>\n",
       "    <dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\"/>\n",
       "    <dc:date>2024-09-11T11:08:17.357669</dc:date>\n",
       "    <dc:format>image/svg+xml</dc:format>\n",
       "    <dc:creator>\n",
       "     <cc:Agent>\n",
       "      <dc:title>Matplotlib v3.9.2, https://matplotlib.org/</dc:title>\n",
       "     </cc:Agent>\n",
       "    </dc:creator>\n",
       "   </cc:Work>\n",
       "  </rdf:RDF>\n",
       " </metadata>\n",
       " <defs>\n",
       "  <style type=\"text/css\">*{stroke-linejoin: round; stroke-linecap: butt}</style>\n",
       " </defs>\n",
       " <g id=\"figure_1\">\n",
       "  <g id=\"patch_1\">\n",
       "   <path d=\"M 0 422.886795 \n",
       "L 611.2125 422.886795 \n",
       "L 611.2125 0 \n",
       "L 0 0 \n",
       "z\n",
       "\" style=\"fill: #ffffff\"/>\n",
       "  </g>\n",
       "  <g id=\"axes_1\">\n",
       "   <g id=\"patch_2\">\n",
       "    <path d=\"M 46.0125 339.84 \n",
       "L 604.0125 339.84 \n",
       "L 604.0125 7.2 \n",
       "L 46.0125 7.2 \n",
       "z\n",
       "\" style=\"fill: #ffffff\"/>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_1\">\n",
       "    <g id=\"xtick_1\">\n",
       "     <g id=\"line2d_1\">\n",
       "      <defs>\n",
       "       <path id=\"mf8b7549fe7\" d=\"M 0 0 \n",
       "L 0 3.5 \n",
       "\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </defs>\n",
       "      <g>\n",
       "       <use xlink:href=\"#mf8b7549fe7\" x=\"71.376136\" y=\"339.84\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_1\">\n",
       "      <!-- 2020-01-24 -->\n",
       "      <g transform=\"translate(59.236919 400.968826) rotate(-60) scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path id=\"DejaVuSans-32\" d=\"M 1228 531 \n",
       "L 3431 531 \n",
       "L 3431 0 \n",
       "L 469 0 \n",
       "L 469 531 \n",
       "Q 828 903 1448 1529 \n",
       "Q 2069 2156 2228 2338 \n",
       "Q 2531 2678 2651 2914 \n",
       "Q 2772 3150 2772 3378 \n",
       "Q 2772 3750 2511 3984 \n",
       "Q 2250 4219 1831 4219 \n",
       "Q 1534 4219 1204 4116 \n",
       "Q 875 4013 500 3803 \n",
       "L 500 4441 \n",
       "Q 881 4594 1212 4672 \n",
       "Q 1544 4750 1819 4750 \n",
       "Q 2544 4750 2975 4387 \n",
       "Q 3406 4025 3406 3419 \n",
       "Q 3406 3131 3298 2873 \n",
       "Q 3191 2616 2906 2266 \n",
       "Q 2828 2175 2409 1742 \n",
       "Q 1991 1309 1228 531 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "        <path id=\"DejaVuSans-30\" d=\"M 2034 4250 \n",
       "Q 1547 4250 1301 3770 \n",
       "Q 1056 3291 1056 2328 \n",
       "Q 1056 1369 1301 889 \n",
       "Q 1547 409 2034 409 \n",
       "Q 2525 409 2770 889 \n",
       "Q 3016 1369 3016 2328 \n",
       "Q 3016 3291 2770 3770 \n",
       "Q 2525 4250 2034 4250 \n",
       "z\n",
       "M 2034 4750 \n",
       "Q 2819 4750 3233 4129 \n",
       "Q 3647 3509 3647 2328 \n",
       "Q 3647 1150 3233 529 \n",
       "Q 2819 -91 2034 -91 \n",
       "Q 1250 -91 836 529 \n",
       "Q 422 1150 422 2328 \n",
       "Q 422 3509 836 4129 \n",
       "Q 1250 4750 2034 4750 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "        <path id=\"DejaVuSans-2d\" d=\"M 313 2009 \n",
       "L 1997 2009 \n",
       "L 1997 1497 \n",
       "L 313 1497 \n",
       "L 313 2009 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "        <path id=\"DejaVuSans-31\" d=\"M 794 531 \n",
       "L 1825 531 \n",
       "L 1825 4091 \n",
       "L 703 3866 \n",
       "L 703 4441 \n",
       "L 1819 4666 \n",
       "L 2450 4666 \n",
       "L 2450 531 \n",
       "L 3481 531 \n",
       "L 3481 0 \n",
       "L 794 0 \n",
       "L 794 531 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "        <path id=\"DejaVuSans-34\" d=\"M 2419 4116 \n",
       "L 825 1625 \n",
       "L 2419 1625 \n",
       "L 2419 4116 \n",
       "z\n",
       "M 2253 4666 \n",
       "L 3047 4666 \n",
       "L 3047 1625 \n",
       "L 3713 1625 \n",
       "L 3713 1100 \n",
       "L 3047 1100 \n",
       "L 3047 0 \n",
       "L 2419 0 \n",
       "L 2419 1100 \n",
       "L 313 1100 \n",
       "L 313 1709 \n",
       "L 2253 4666 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-32\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-32\" x=\"127.246094\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"190.869141\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-2d\" x=\"254.492188\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"290.576172\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-31\" x=\"354.199219\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-2d\" x=\"417.822266\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-32\" x=\"453.90625\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-34\" x=\"517.529297\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_2\">\n",
       "     <g id=\"line2d_2\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#mf8b7549fe7\" x=\"181.652816\" y=\"339.84\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_2\">\n",
       "      <!-- 2020-02-03 -->\n",
       "      <g transform=\"translate(169.513599 400.968826) rotate(-60) scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path id=\"DejaVuSans-33\" d=\"M 2597 2516 \n",
       "Q 3050 2419 3304 2112 \n",
       "Q 3559 1806 3559 1356 \n",
       "Q 3559 666 3084 287 \n",
       "Q 2609 -91 1734 -91 \n",
       "Q 1441 -91 1130 -33 \n",
       "Q 819 25 488 141 \n",
       "L 488 750 \n",
       "Q 750 597 1062 519 \n",
       "Q 1375 441 1716 441 \n",
       "Q 2309 441 2620 675 \n",
       "Q 2931 909 2931 1356 \n",
       "Q 2931 1769 2642 2001 \n",
       "Q 2353 2234 1838 2234 \n",
       "L 1294 2234 \n",
       "L 1294 2753 \n",
       "L 1863 2753 \n",
       "Q 2328 2753 2575 2939 \n",
       "Q 2822 3125 2822 3475 \n",
       "Q 2822 3834 2567 4026 \n",
       "Q 2313 4219 1838 4219 \n",
       "Q 1578 4219 1281 4162 \n",
       "Q 984 4106 628 3988 \n",
       "L 628 4550 \n",
       "Q 988 4650 1302 4700 \n",
       "Q 1616 4750 1894 4750 \n",
       "Q 2613 4750 3031 4423 \n",
       "Q 3450 4097 3450 3541 \n",
       "Q 3450 3153 3228 2886 \n",
       "Q 3006 2619 2597 2516 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-32\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-32\" x=\"127.246094\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"190.869141\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-2d\" x=\"254.492188\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"290.576172\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-32\" x=\"354.199219\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-2d\" x=\"417.822266\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"453.90625\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-33\" x=\"517.529297\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_3\">\n",
       "     <g id=\"line2d_3\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#mf8b7549fe7\" x=\"291.929496\" y=\"339.84\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_3\">\n",
       "      <!-- 2020-02-13 -->\n",
       "      <g transform=\"translate(279.790279 400.968826) rotate(-60) scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-32\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-32\" x=\"127.246094\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"190.869141\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-2d\" x=\"254.492188\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"290.576172\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-32\" x=\"354.199219\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-2d\" x=\"417.822266\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-31\" x=\"453.90625\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-33\" x=\"517.529297\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_4\">\n",
       "     <g id=\"line2d_4\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#mf8b7549fe7\" x=\"402.206176\" y=\"339.84\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_4\">\n",
       "      <!-- 2020-02-23 -->\n",
       "      <g transform=\"translate(390.066958 400.968826) rotate(-60) scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-32\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-32\" x=\"127.246094\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"190.869141\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-2d\" x=\"254.492188\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"290.576172\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-32\" x=\"354.199219\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-2d\" x=\"417.822266\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-32\" x=\"453.90625\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-33\" x=\"517.529297\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_5\">\n",
       "     <g id=\"line2d_5\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#mf8b7549fe7\" x=\"512.482856\" y=\"339.84\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_5\">\n",
       "      <!-- 2020-03-04 -->\n",
       "      <g transform=\"translate(500.343638 400.968826) rotate(-60) scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-32\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-32\" x=\"127.246094\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"190.869141\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-2d\" x=\"254.492188\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"290.576172\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-33\" x=\"354.199219\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-2d\" x=\"417.822266\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"453.90625\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-34\" x=\"517.529297\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"text_6\">\n",
       "     <!-- date -->\n",
       "     <g transform=\"translate(313.7375 413.607108) scale(0.1 -0.1)\">\n",
       "      <defs>\n",
       "       <path id=\"DejaVuSans-64\" d=\"M 2906 2969 \n",
       "L 2906 4863 \n",
       "L 3481 4863 \n",
       "L 3481 0 \n",
       "L 2906 0 \n",
       "L 2906 525 \n",
       "Q 2725 213 2448 61 \n",
       "Q 2172 -91 1784 -91 \n",
       "Q 1150 -91 751 415 \n",
       "Q 353 922 353 1747 \n",
       "Q 353 2572 751 3078 \n",
       "Q 1150 3584 1784 3584 \n",
       "Q 2172 3584 2448 3432 \n",
       "Q 2725 3281 2906 2969 \n",
       "z\n",
       "M 947 1747 \n",
       "Q 947 1113 1208 752 \n",
       "Q 1469 391 1925 391 \n",
       "Q 2381 391 2643 752 \n",
       "Q 2906 1113 2906 1747 \n",
       "Q 2906 2381 2643 2742 \n",
       "Q 2381 3103 1925 3103 \n",
       "Q 1469 3103 1208 2742 \n",
       "Q 947 2381 947 1747 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       <path id=\"DejaVuSans-61\" d=\"M 2194 1759 \n",
       "Q 1497 1759 1228 1600 \n",
       "Q 959 1441 959 1056 \n",
       "Q 959 750 1161 570 \n",
       "Q 1363 391 1709 391 \n",
       "Q 2188 391 2477 730 \n",
       "Q 2766 1069 2766 1631 \n",
       "L 2766 1759 \n",
       "L 2194 1759 \n",
       "z\n",
       "M 3341 1997 \n",
       "L 3341 0 \n",
       "L 2766 0 \n",
       "L 2766 531 \n",
       "Q 2569 213 2275 61 \n",
       "Q 1981 -91 1556 -91 \n",
       "Q 1019 -91 701 211 \n",
       "Q 384 513 384 1019 \n",
       "Q 384 1609 779 1909 \n",
       "Q 1175 2209 1959 2209 \n",
       "L 2766 2209 \n",
       "L 2766 2266 \n",
       "Q 2766 2663 2505 2880 \n",
       "Q 2244 3097 1772 3097 \n",
       "Q 1472 3097 1187 3025 \n",
       "Q 903 2953 641 2809 \n",
       "L 641 3341 \n",
       "Q 956 3463 1253 3523 \n",
       "Q 1550 3584 1831 3584 \n",
       "Q 2591 3584 2966 3190 \n",
       "Q 3341 2797 3341 1997 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       <path id=\"DejaVuSans-74\" d=\"M 1172 4494 \n",
       "L 1172 3500 \n",
       "L 2356 3500 \n",
       "L 2356 3053 \n",
       "L 1172 3053 \n",
       "L 1172 1153 \n",
       "Q 1172 725 1289 603 \n",
       "Q 1406 481 1766 481 \n",
       "L 2356 481 \n",
       "L 2356 0 \n",
       "L 1766 0 \n",
       "Q 1100 0 847 248 \n",
       "Q 594 497 594 1153 \n",
       "L 594 3053 \n",
       "L 172 3053 \n",
       "L 172 3500 \n",
       "L 594 3500 \n",
       "L 594 4494 \n",
       "L 1172 4494 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       <path id=\"DejaVuSans-65\" d=\"M 3597 1894 \n",
       "L 3597 1613 \n",
       "L 953 1613 \n",
       "Q 991 1019 1311 708 \n",
       "Q 1631 397 2203 397 \n",
       "Q 2534 397 2845 478 \n",
       "Q 3156 559 3463 722 \n",
       "L 3463 178 \n",
       "Q 3153 47 2828 -22 \n",
       "Q 2503 -91 2169 -91 \n",
       "Q 1331 -91 842 396 \n",
       "Q 353 884 353 1716 \n",
       "Q 353 2575 817 3079 \n",
       "Q 1281 3584 2069 3584 \n",
       "Q 2775 3584 3186 3129 \n",
       "Q 3597 2675 3597 1894 \n",
       "z\n",
       "M 3022 2063 \n",
       "Q 3016 2534 2758 2815 \n",
       "Q 2500 3097 2075 3097 \n",
       "Q 1594 3097 1305 2825 \n",
       "Q 1016 2553 972 2059 \n",
       "L 3022 2063 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "      </defs>\n",
       "      <use xlink:href=\"#DejaVuSans-64\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-61\" x=\"63.476562\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-74\" x=\"124.755859\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-65\" x=\"163.964844\"/>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_2\">\n",
       "    <g id=\"ytick_1\">\n",
       "     <g id=\"line2d_6\">\n",
       "      <defs>\n",
       "       <path id=\"md636faea29\" d=\"M 0 0 \n",
       "L -3.5 0 \n",
       "\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </defs>\n",
       "      <g>\n",
       "       <use xlink:href=\"#md636faea29\" x=\"46.0125\" y=\"324.813647\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_7\">\n",
       "      <!-- 0 -->\n",
       "      <g transform=\"translate(32.65 328.612865) scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_2\">\n",
       "     <g id=\"line2d_7\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#md636faea29\" x=\"46.0125\" y=\"287.354989\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_8\">\n",
       "      <!-- 10000 -->\n",
       "      <g transform=\"translate(7.2 291.154207) scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-31\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"127.246094\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"190.869141\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"254.492188\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_3\">\n",
       "     <g id=\"line2d_8\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#md636faea29\" x=\"46.0125\" y=\"249.896331\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_9\">\n",
       "      <!-- 20000 -->\n",
       "      <g transform=\"translate(7.2 253.695549) scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-32\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"127.246094\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"190.869141\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"254.492188\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_4\">\n",
       "     <g id=\"line2d_9\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#md636faea29\" x=\"46.0125\" y=\"212.437673\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_10\">\n",
       "      <!-- 30000 -->\n",
       "      <g transform=\"translate(7.2 216.236891) scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-33\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"127.246094\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"190.869141\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"254.492188\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_5\">\n",
       "     <g id=\"line2d_10\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#md636faea29\" x=\"46.0125\" y=\"174.979015\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_11\">\n",
       "      <!-- 40000 -->\n",
       "      <g transform=\"translate(7.2 178.778233) scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-34\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"127.246094\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"190.869141\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"254.492188\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_6\">\n",
       "     <g id=\"line2d_11\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#md636faea29\" x=\"46.0125\" y=\"137.520357\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_12\">\n",
       "      <!-- 50000 -->\n",
       "      <g transform=\"translate(7.2 141.319575) scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path id=\"DejaVuSans-35\" d=\"M 691 4666 \n",
       "L 3169 4666 \n",
       "L 3169 4134 \n",
       "L 1269 4134 \n",
       "L 1269 2991 \n",
       "Q 1406 3038 1543 3061 \n",
       "Q 1681 3084 1819 3084 \n",
       "Q 2600 3084 3056 2656 \n",
       "Q 3513 2228 3513 1497 \n",
       "Q 3513 744 3044 326 \n",
       "Q 2575 -91 1722 -91 \n",
       "Q 1428 -91 1123 -41 \n",
       "Q 819 9 494 109 \n",
       "L 494 744 \n",
       "Q 775 591 1075 516 \n",
       "Q 1375 441 1709 441 \n",
       "Q 2250 441 2565 725 \n",
       "Q 2881 1009 2881 1497 \n",
       "Q 2881 1984 2565 2268 \n",
       "Q 2250 2553 1709 2553 \n",
       "Q 1456 2553 1204 2497 \n",
       "Q 953 2441 691 2322 \n",
       "L 691 4666 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-35\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"127.246094\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"190.869141\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"254.492188\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_7\">\n",
       "     <g id=\"line2d_12\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#md636faea29\" x=\"46.0125\" y=\"100.061699\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_13\">\n",
       "      <!-- 60000 -->\n",
       "      <g transform=\"translate(7.2 103.860918) scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path id=\"DejaVuSans-36\" d=\"M 2113 2584 \n",
       "Q 1688 2584 1439 2293 \n",
       "Q 1191 2003 1191 1497 \n",
       "Q 1191 994 1439 701 \n",
       "Q 1688 409 2113 409 \n",
       "Q 2538 409 2786 701 \n",
       "Q 3034 994 3034 1497 \n",
       "Q 3034 2003 2786 2293 \n",
       "Q 2538 2584 2113 2584 \n",
       "z\n",
       "M 3366 4563 \n",
       "L 3366 3988 \n",
       "Q 3128 4100 2886 4159 \n",
       "Q 2644 4219 2406 4219 \n",
       "Q 1781 4219 1451 3797 \n",
       "Q 1122 3375 1075 2522 \n",
       "Q 1259 2794 1537 2939 \n",
       "Q 1816 3084 2150 3084 \n",
       "Q 2853 3084 3261 2657 \n",
       "Q 3669 2231 3669 1497 \n",
       "Q 3669 778 3244 343 \n",
       "Q 2819 -91 2113 -91 \n",
       "Q 1303 -91 875 529 \n",
       "Q 447 1150 447 2328 \n",
       "Q 447 3434 972 4092 \n",
       "Q 1497 4750 2381 4750 \n",
       "Q 2619 4750 2861 4703 \n",
       "Q 3103 4656 3366 4563 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-36\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"127.246094\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"190.869141\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"254.492188\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_8\">\n",
       "     <g id=\"line2d_13\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#md636faea29\" x=\"46.0125\" y=\"62.603041\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_14\">\n",
       "      <!-- 70000 -->\n",
       "      <g transform=\"translate(7.2 66.40226) scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path id=\"DejaVuSans-37\" d=\"M 525 4666 \n",
       "L 3525 4666 \n",
       "L 3525 4397 \n",
       "L 1831 0 \n",
       "L 1172 0 \n",
       "L 2766 4134 \n",
       "L 525 4134 \n",
       "L 525 4666 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-37\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"127.246094\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"190.869141\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"254.492188\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_9\">\n",
       "     <g id=\"line2d_14\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#md636faea29\" x=\"46.0125\" y=\"25.144383\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_15\">\n",
       "      <!-- 80000 -->\n",
       "      <g transform=\"translate(7.2 28.943602) scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path id=\"DejaVuSans-38\" d=\"M 2034 2216 \n",
       "Q 1584 2216 1326 1975 \n",
       "Q 1069 1734 1069 1313 \n",
       "Q 1069 891 1326 650 \n",
       "Q 1584 409 2034 409 \n",
       "Q 2484 409 2743 651 \n",
       "Q 3003 894 3003 1313 \n",
       "Q 3003 1734 2745 1975 \n",
       "Q 2488 2216 2034 2216 \n",
       "z\n",
       "M 1403 2484 \n",
       "Q 997 2584 770 2862 \n",
       "Q 544 3141 544 3541 \n",
       "Q 544 4100 942 4425 \n",
       "Q 1341 4750 2034 4750 \n",
       "Q 2731 4750 3128 4425 \n",
       "Q 3525 4100 3525 3541 \n",
       "Q 3525 3141 3298 2862 \n",
       "Q 3072 2584 2669 2484 \n",
       "Q 3125 2378 3379 2068 \n",
       "Q 3634 1759 3634 1313 \n",
       "Q 3634 634 3220 271 \n",
       "Q 2806 -91 2034 -91 \n",
       "Q 1263 -91 848 271 \n",
       "Q 434 634 434 1313 \n",
       "Q 434 1759 690 2068 \n",
       "Q 947 2378 1403 2484 \n",
       "z\n",
       "M 1172 3481 \n",
       "Q 1172 3119 1398 2916 \n",
       "Q 1625 2713 2034 2713 \n",
       "Q 2441 2713 2670 2916 \n",
       "Q 2900 3119 2900 3481 \n",
       "Q 2900 3844 2670 4047 \n",
       "Q 2441 4250 2034 4250 \n",
       "Q 1625 4250 1398 4047 \n",
       "Q 1172 3844 1172 3481 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-38\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"127.246094\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"190.869141\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"254.492188\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"line2d_15\">\n",
       "    <path d=\"M 71.376136 321.704578 \n",
       "L 82.403804 319.992717 \n",
       "L 93.431472 317.415562 \n",
       "L 104.45914 314.534991 \n",
       "L 115.486808 307.901063 \n",
       "L 126.514476 302.435844 \n",
       "L 137.542144 295.929275 \n",
       "L 148.569812 288.508715 \n",
       "L 159.59748 280.646143 \n",
       "L 170.625148 270.948096 \n",
       "L 181.652816 260.366026 \n",
       "L 192.680484 248.255641 \n",
       "L 203.708152 233.699207 \n",
       "L 214.73582 219.861979 \n",
       "L 225.763488 208.088723 \n",
       "L 236.791156 195.408967 \n",
       "L 247.818824 185.474931 \n",
       "L 258.846492 174.338472 \n",
       "L 269.87416 165.097421 \n",
       "L 280.901828 157.549501 \n",
       "L 291.929496 100.795888 \n",
       "L 302.957164 85.63637 \n",
       "L 313.984832 75.743538 \n",
       "L 325.0125 68.221839 \n",
       "L 336.040168 60.550306 \n",
       "L 347.067836 53.478112 \n",
       "L 358.095504 46.926592 \n",
       "L 369.123172 45.461959 \n",
       "L 380.15084 42.131884 \n",
       "L 391.178508 39.049037 \n",
       "L 402.206176 36.621716 \n",
       "L 413.233844 35.8201 \n",
       "L 424.261512 33.917201 \n",
       "L 435.28918 32.396379 \n",
       "L 446.316848 30.774419 \n",
       "L 457.344516 29.549521 \n",
       "L 468.372184 27.950036 \n",
       "L 479.399852 25.803655 \n",
       "L 490.42752 25.04699 \n",
       "L 501.455188 24.578757 \n",
       "L 512.482856 24.132999 \n",
       "L 523.510524 23.612324 \n",
       "L 534.538192 23.076665 \n",
       "L 545.56586 22.705824 \n",
       "L 556.593528 22.541006 \n",
       "L 567.621196 22.391171 \n",
       "L 578.648864 22.32 \n",
       "\" clip-path=\"url(#p3859fc14b9)\" style=\"fill: none; stroke: #1f77b4; stroke-width: 1.5; stroke-linecap: square\"/>\n",
       "   </g>\n",
       "   <g id=\"line2d_16\">\n",
       "    <path d=\"M 71.376136 324.686287 \n",
       "L 82.403804 324.671304 \n",
       "L 93.431472 324.630099 \n",
       "L 104.45914 324.622607 \n",
       "L 115.486808 324.588895 \n",
       "L 126.514476 324.427822 \n",
       "L 137.542144 324.349159 \n",
       "L 148.569812 324.173104 \n",
       "L 159.59748 323.843467 \n",
       "L 170.625148 323.585003 \n",
       "L 181.652816 323.03436 \n",
       "L 192.680484 322.446259 \n",
       "L 203.708152 321.472334 \n",
       "L 214.73582 320.494663 \n",
       "L 225.763488 319.045013 \n",
       "L 236.791156 317.134622 \n",
       "L 247.818824 314.890848 \n",
       "L 258.846492 312.523461 \n",
       "L 269.87416 309.845167 \n",
       "L 280.901828 307.058243 \n",
       "L 291.929496 302.671834 \n",
       "L 302.957164 299.630191 \n",
       "L 313.984832 294.487117 \n",
       "L 325.0125 289.531337 \n",
       "L 336.040168 284.193478 \n",
       "L 347.067836 277.795539 \n",
       "L 358.095504 270.96308 \n",
       "L 369.123172 264.299185 \n",
       "L 380.15084 256.399154 \n",
       "L 391.178508 247.427805 \n",
       "L 402.206176 239.07827 \n",
       "L 413.233844 232.163402 \n",
       "L 424.261512 222.465355 \n",
       "L 435.28918 213.392868 \n",
       "L 446.316848 203.091738 \n",
       "L 457.344516 189.524212 \n",
       "L 468.372184 178.717389 \n",
       "L 479.399852 168.891983 \n",
       "L 490.42752 158.264962 \n",
       "L 501.455188 147.993798 \n",
       "L 512.482856 138.059761 \n",
       "L 523.510524 129.860061 \n",
       "L 534.538192 123.563261 \n",
       "L 545.56586 117.277698 \n",
       "L 556.593528 111.055815 \n",
       "L 567.621196 105.305911 \n",
       "L 578.648864 100.447523 \n",
       "\" clip-path=\"url(#p3859fc14b9)\" style=\"fill: none; stroke: #ff7f0e; stroke-width: 1.5; stroke-linecap: square\"/>\n",
       "   </g>\n",
       "   <g id=\"line2d_17\">\n",
       "    <path d=\"M 71.376136 324.72 \n",
       "L 82.403804 324.660066 \n",
       "L 93.431472 324.603878 \n",
       "L 104.45914 324.513977 \n",
       "L 115.486808 324.416585 \n",
       "L 126.514476 324.319192 \n",
       "L 137.542144 324.176849 \n",
       "L 148.569812 324.015777 \n",
       "L 159.59748 323.903401 \n",
       "L 170.625148 323.674903 \n",
       "L 181.652816 323.461389 \n",
       "L 192.680484 323.221654 \n",
       "L 203.708152 322.978172 \n",
       "L 214.73582 322.704724 \n",
       "L 225.763488 322.431276 \n",
       "L 236.791156 322.109132 \n",
       "L 247.818824 321.775749 \n",
       "L 258.846492 321.412401 \n",
       "L 269.87416 321.007847 \n",
       "L 280.901828 320.644498 \n",
       "L 291.929496 319.693048 \n",
       "L 302.957164 319.644352 \n",
       "L 313.984832 319.108693 \n",
       "L 325.0125 318.57678 \n",
       "L 336.040168 318.183464 \n",
       "L 347.067836 317.816369 \n",
       "L 358.095504 317.306932 \n",
       "L 369.123172 316.879903 \n",
       "L 380.15084 316.437891 \n",
       "L 391.178508 316.029591 \n",
       "L 402.206176 315.666242 \n",
       "L 413.233844 315.104362 \n",
       "L 424.261512 314.838406 \n",
       "L 435.28918 314.643621 \n",
       "L 446.316848 314.534991 \n",
       "L 457.344516 314.370173 \n",
       "L 468.372184 314.194117 \n",
       "L 479.399852 314.063012 \n",
       "L 490.42752 313.905685 \n",
       "L 501.455188 313.789564 \n",
       "L 512.482856 313.647221 \n",
       "L 523.510524 313.531099 \n",
       "L 534.538192 313.418723 \n",
       "L 545.56586 313.313839 \n",
       "L 556.593528 313.2127 \n",
       "L 567.621196 313.130291 \n",
       "L 578.648864 313.066612 \n",
       "\" clip-path=\"url(#p3859fc14b9)\" style=\"fill: none; stroke: #2ca02c; stroke-width: 1.5; stroke-linecap: square\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_3\">\n",
       "    <path d=\"M 46.0125 339.84 \n",
       "L 46.0125 7.2 \n",
       "\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_4\">\n",
       "    <path d=\"M 604.0125 339.84 \n",
       "L 604.0125 7.2 \n",
       "\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_5\">\n",
       "    <path d=\"M 46.0125 339.84 \n",
       "L 604.0125 339.84 \n",
       "\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_6\">\n",
       "    <path d=\"M 46.0125 7.2 \n",
       "L 604.0125 7.2 \n",
       "\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n",
       "   </g>\n",
       "   <g id=\"legend_1\">\n",
       "    <g id=\"patch_7\">\n",
       "     <path d=\"M 53.0125 60.06875 \n",
       "L 162.859375 60.06875 \n",
       "Q 164.859375 60.06875 164.859375 58.06875 \n",
       "L 164.859375 14.2 \n",
       "Q 164.859375 12.2 162.859375 12.2 \n",
       "L 53.0125 12.2 \n",
       "Q 51.0125 12.2 51.0125 14.2 \n",
       "L 51.0125 58.06875 \n",
       "Q 51.0125 60.06875 53.0125 60.06875 \n",
       "z\n",
       "\" style=\"fill: #ffffff; opacity: 0.8; stroke: #cccccc; stroke-linejoin: miter\"/>\n",
       "    </g>\n",
       "    <g id=\"line2d_18\">\n",
       "     <path d=\"M 55.0125 20.298438 \n",
       "L 65.0125 20.298438 \n",
       "L 75.0125 20.298438 \n",
       "\" style=\"fill: none; stroke: #1f77b4; stroke-width: 1.5; stroke-linecap: square\"/>\n",
       "    </g>\n",
       "    <g id=\"text_16\">\n",
       "     <!-- confirmed_num -->\n",
       "     <g transform=\"translate(83.0125 23.798438) scale(0.1 -0.1)\">\n",
       "      <defs>\n",
       "       <path id=\"DejaVuSans-63\" d=\"M 3122 3366 \n",
       "L 3122 2828 \n",
       "Q 2878 2963 2633 3030 \n",
       "Q 2388 3097 2138 3097 \n",
       "Q 1578 3097 1268 2742 \n",
       "Q 959 2388 959 1747 \n",
       "Q 959 1106 1268 751 \n",
       "Q 1578 397 2138 397 \n",
       "Q 2388 397 2633 464 \n",
       "Q 2878 531 3122 666 \n",
       "L 3122 134 \n",
       "Q 2881 22 2623 -34 \n",
       "Q 2366 -91 2075 -91 \n",
       "Q 1284 -91 818 406 \n",
       "Q 353 903 353 1747 \n",
       "Q 353 2603 823 3093 \n",
       "Q 1294 3584 2113 3584 \n",
       "Q 2378 3584 2631 3529 \n",
       "Q 2884 3475 3122 3366 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       <path id=\"DejaVuSans-6f\" d=\"M 1959 3097 \n",
       "Q 1497 3097 1228 2736 \n",
       "Q 959 2375 959 1747 \n",
       "Q 959 1119 1226 758 \n",
       "Q 1494 397 1959 397 \n",
       "Q 2419 397 2687 759 \n",
       "Q 2956 1122 2956 1747 \n",
       "Q 2956 2369 2687 2733 \n",
       "Q 2419 3097 1959 3097 \n",
       "z\n",
       "M 1959 3584 \n",
       "Q 2709 3584 3137 3096 \n",
       "Q 3566 2609 3566 1747 \n",
       "Q 3566 888 3137 398 \n",
       "Q 2709 -91 1959 -91 \n",
       "Q 1206 -91 779 398 \n",
       "Q 353 888 353 1747 \n",
       "Q 353 2609 779 3096 \n",
       "Q 1206 3584 1959 3584 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       <path id=\"DejaVuSans-6e\" d=\"M 3513 2113 \n",
       "L 3513 0 \n",
       "L 2938 0 \n",
       "L 2938 2094 \n",
       "Q 2938 2591 2744 2837 \n",
       "Q 2550 3084 2163 3084 \n",
       "Q 1697 3084 1428 2787 \n",
       "Q 1159 2491 1159 1978 \n",
       "L 1159 0 \n",
       "L 581 0 \n",
       "L 581 3500 \n",
       "L 1159 3500 \n",
       "L 1159 2956 \n",
       "Q 1366 3272 1645 3428 \n",
       "Q 1925 3584 2291 3584 \n",
       "Q 2894 3584 3203 3211 \n",
       "Q 3513 2838 3513 2113 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       <path id=\"DejaVuSans-66\" d=\"M 2375 4863 \n",
       "L 2375 4384 \n",
       "L 1825 4384 \n",
       "Q 1516 4384 1395 4259 \n",
       "Q 1275 4134 1275 3809 \n",
       "L 1275 3500 \n",
       "L 2222 3500 \n",
       "L 2222 3053 \n",
       "L 1275 3053 \n",
       "L 1275 0 \n",
       "L 697 0 \n",
       "L 697 3053 \n",
       "L 147 3053 \n",
       "L 147 3500 \n",
       "L 697 3500 \n",
       "L 697 3744 \n",
       "Q 697 4328 969 4595 \n",
       "Q 1241 4863 1831 4863 \n",
       "L 2375 4863 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       <path id=\"DejaVuSans-69\" d=\"M 603 3500 \n",
       "L 1178 3500 \n",
       "L 1178 0 \n",
       "L 603 0 \n",
       "L 603 3500 \n",
       "z\n",
       "M 603 4863 \n",
       "L 1178 4863 \n",
       "L 1178 4134 \n",
       "L 603 4134 \n",
       "L 603 4863 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       <path id=\"DejaVuSans-72\" d=\"M 2631 2963 \n",
       "Q 2534 3019 2420 3045 \n",
       "Q 2306 3072 2169 3072 \n",
       "Q 1681 3072 1420 2755 \n",
       "Q 1159 2438 1159 1844 \n",
       "L 1159 0 \n",
       "L 581 0 \n",
       "L 581 3500 \n",
       "L 1159 3500 \n",
       "L 1159 2956 \n",
       "Q 1341 3275 1631 3429 \n",
       "Q 1922 3584 2338 3584 \n",
       "Q 2397 3584 2469 3576 \n",
       "Q 2541 3569 2628 3553 \n",
       "L 2631 2963 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       <path id=\"DejaVuSans-6d\" d=\"M 3328 2828 \n",
       "Q 3544 3216 3844 3400 \n",
       "Q 4144 3584 4550 3584 \n",
       "Q 5097 3584 5394 3201 \n",
       "Q 5691 2819 5691 2113 \n",
       "L 5691 0 \n",
       "L 5113 0 \n",
       "L 5113 2094 \n",
       "Q 5113 2597 4934 2840 \n",
       "Q 4756 3084 4391 3084 \n",
       "Q 3944 3084 3684 2787 \n",
       "Q 3425 2491 3425 1978 \n",
       "L 3425 0 \n",
       "L 2847 0 \n",
       "L 2847 2094 \n",
       "Q 2847 2600 2669 2842 \n",
       "Q 2491 3084 2119 3084 \n",
       "Q 1678 3084 1418 2786 \n",
       "Q 1159 2488 1159 1978 \n",
       "L 1159 0 \n",
       "L 581 0 \n",
       "L 581 3500 \n",
       "L 1159 3500 \n",
       "L 1159 2956 \n",
       "Q 1356 3278 1631 3431 \n",
       "Q 1906 3584 2284 3584 \n",
       "Q 2666 3584 2933 3390 \n",
       "Q 3200 3197 3328 2828 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       <path id=\"DejaVuSans-5f\" d=\"M 3263 -1063 \n",
       "L 3263 -1509 \n",
       "L -63 -1509 \n",
       "L -63 -1063 \n",
       "L 3263 -1063 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       <path id=\"DejaVuSans-75\" d=\"M 544 1381 \n",
       "L 544 3500 \n",
       "L 1119 3500 \n",
       "L 1119 1403 \n",
       "Q 1119 906 1312 657 \n",
       "Q 1506 409 1894 409 \n",
       "Q 2359 409 2629 706 \n",
       "Q 2900 1003 2900 1516 \n",
       "L 2900 3500 \n",
       "L 3475 3500 \n",
       "L 3475 0 \n",
       "L 2900 0 \n",
       "L 2900 538 \n",
       "Q 2691 219 2414 64 \n",
       "Q 2138 -91 1772 -91 \n",
       "Q 1169 -91 856 284 \n",
       "Q 544 659 544 1381 \n",
       "z\n",
       "M 1991 3584 \n",
       "L 1991 3584 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "      </defs>\n",
       "      <use xlink:href=\"#DejaVuSans-63\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-6f\" x=\"54.980469\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-6e\" x=\"116.162109\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-66\" x=\"179.541016\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-69\" x=\"214.746094\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-72\" x=\"242.529297\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-6d\" x=\"281.892578\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-65\" x=\"379.304688\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-64\" x=\"440.828125\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-5f\" x=\"504.304688\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-6e\" x=\"554.304688\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-75\" x=\"617.683594\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-6d\" x=\"681.0625\"/>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"line2d_19\">\n",
       "     <path d=\"M 55.0125 35.254688 \n",
       "L 65.0125 35.254688 \n",
       "L 75.0125 35.254688 \n",
       "\" style=\"fill: none; stroke: #ff7f0e; stroke-width: 1.5; stroke-linecap: square\"/>\n",
       "    </g>\n",
       "    <g id=\"text_17\">\n",
       "     <!-- cured_num -->\n",
       "     <g transform=\"translate(83.0125 38.754688) scale(0.1 -0.1)\">\n",
       "      <use xlink:href=\"#DejaVuSans-63\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-75\" x=\"54.980469\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-72\" x=\"118.359375\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-65\" x=\"157.222656\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-64\" x=\"218.746094\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-5f\" x=\"282.222656\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-6e\" x=\"332.222656\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-75\" x=\"395.601562\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-6d\" x=\"458.980469\"/>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"line2d_20\">\n",
       "     <path d=\"M 55.0125 50.210938 \n",
       "L 65.0125 50.210938 \n",
       "L 75.0125 50.210938 \n",
       "\" style=\"fill: none; stroke: #2ca02c; stroke-width: 1.5; stroke-linecap: square\"/>\n",
       "    </g>\n",
       "    <g id=\"text_18\">\n",
       "     <!-- dead_num -->\n",
       "     <g transform=\"translate(83.0125 53.710938) scale(0.1 -0.1)\">\n",
       "      <use xlink:href=\"#DejaVuSans-64\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-65\" x=\"63.476562\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-61\" x=\"125\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-64\" x=\"186.279297\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-5f\" x=\"249.755859\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-6e\" x=\"299.755859\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-75\" x=\"363.134766\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-6d\" x=\"426.513672\"/>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "  </g>\n",
       " </g>\n",
       " <defs>\n",
       "  <clipPath id=\"p3859fc14b9\">\n",
       "   <rect x=\"46.0125\" y=\"7.2\" width=\"558\" height=\"332.64\"/>\n",
       "  </clipPath>\n",
       " </defs>\n",
       "</svg>\n"
      ],
      "text/plain": [
       "<Figure size 1000x600 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "%matplotlib inline\n",
    "%config InlineBackend.figure_format = 'svg'\n",
    "\n",
    "df = pd.read_csv(\"./eat_pytorch_datasets/covid-19.csv\",sep = \"\\t\")\n",
    "df.plot(x = \"date\",y = [\"confirmed_num\",\"cured_num\",\"dead_num\"],figsize=(10,6))\n",
    "plt.xticks(rotation=60);\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "id": "e5a55006",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n",
       "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
       "  \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
       "<svg xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"611.2125pt\" height=\"422.886795pt\" viewBox=\"0 0 611.2125 422.886795\" xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\">\n",
       " <metadata>\n",
       "  <rdf:RDF xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n",
       "   <cc:Work>\n",
       "    <dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\"/>\n",
       "    <dc:date>2024-09-11T11:08:19.867955</dc:date>\n",
       "    <dc:format>image/svg+xml</dc:format>\n",
       "    <dc:creator>\n",
       "     <cc:Agent>\n",
       "      <dc:title>Matplotlib v3.9.2, https://matplotlib.org/</dc:title>\n",
       "     </cc:Agent>\n",
       "    </dc:creator>\n",
       "   </cc:Work>\n",
       "  </rdf:RDF>\n",
       " </metadata>\n",
       " <defs>\n",
       "  <style type=\"text/css\">*{stroke-linejoin: round; stroke-linecap: butt}</style>\n",
       " </defs>\n",
       " <g id=\"figure_1\">\n",
       "  <g id=\"patch_1\">\n",
       "   <path d=\"M 0 422.886795 \n",
       "L 611.2125 422.886795 \n",
       "L 611.2125 0 \n",
       "L 0 0 \n",
       "z\n",
       "\" style=\"fill: #ffffff\"/>\n",
       "  </g>\n",
       "  <g id=\"axes_1\">\n",
       "   <g id=\"patch_2\">\n",
       "    <path d=\"M 46.0125 339.84 \n",
       "L 604.0125 339.84 \n",
       "L 604.0125 7.2 \n",
       "L 46.0125 7.2 \n",
       "z\n",
       "\" style=\"fill: #ffffff\"/>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_1\">\n",
       "    <g id=\"xtick_1\">\n",
       "     <g id=\"line2d_1\">\n",
       "      <defs>\n",
       "       <path id=\"m4f136aa2f4\" d=\"M 0 0 \n",
       "L 0 3.5 \n",
       "\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </defs>\n",
       "      <g>\n",
       "       <use xlink:href=\"#m4f136aa2f4\" x=\"71.376136\" y=\"339.84\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_1\">\n",
       "      <!-- 2020-01-25 -->\n",
       "      <g transform=\"translate(59.236919 400.968826) rotate(-60) scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path id=\"DejaVuSans-32\" d=\"M 1228 531 \n",
       "L 3431 531 \n",
       "L 3431 0 \n",
       "L 469 0 \n",
       "L 469 531 \n",
       "Q 828 903 1448 1529 \n",
       "Q 2069 2156 2228 2338 \n",
       "Q 2531 2678 2651 2914 \n",
       "Q 2772 3150 2772 3378 \n",
       "Q 2772 3750 2511 3984 \n",
       "Q 2250 4219 1831 4219 \n",
       "Q 1534 4219 1204 4116 \n",
       "Q 875 4013 500 3803 \n",
       "L 500 4441 \n",
       "Q 881 4594 1212 4672 \n",
       "Q 1544 4750 1819 4750 \n",
       "Q 2544 4750 2975 4387 \n",
       "Q 3406 4025 3406 3419 \n",
       "Q 3406 3131 3298 2873 \n",
       "Q 3191 2616 2906 2266 \n",
       "Q 2828 2175 2409 1742 \n",
       "Q 1991 1309 1228 531 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "        <path id=\"DejaVuSans-30\" d=\"M 2034 4250 \n",
       "Q 1547 4250 1301 3770 \n",
       "Q 1056 3291 1056 2328 \n",
       "Q 1056 1369 1301 889 \n",
       "Q 1547 409 2034 409 \n",
       "Q 2525 409 2770 889 \n",
       "Q 3016 1369 3016 2328 \n",
       "Q 3016 3291 2770 3770 \n",
       "Q 2525 4250 2034 4250 \n",
       "z\n",
       "M 2034 4750 \n",
       "Q 2819 4750 3233 4129 \n",
       "Q 3647 3509 3647 2328 \n",
       "Q 3647 1150 3233 529 \n",
       "Q 2819 -91 2034 -91 \n",
       "Q 1250 -91 836 529 \n",
       "Q 422 1150 422 2328 \n",
       "Q 422 3509 836 4129 \n",
       "Q 1250 4750 2034 4750 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "        <path id=\"DejaVuSans-2d\" d=\"M 313 2009 \n",
       "L 1997 2009 \n",
       "L 1997 1497 \n",
       "L 313 1497 \n",
       "L 313 2009 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "        <path id=\"DejaVuSans-31\" d=\"M 794 531 \n",
       "L 1825 531 \n",
       "L 1825 4091 \n",
       "L 703 3866 \n",
       "L 703 4441 \n",
       "L 1819 4666 \n",
       "L 2450 4666 \n",
       "L 2450 531 \n",
       "L 3481 531 \n",
       "L 3481 0 \n",
       "L 794 0 \n",
       "L 794 531 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "        <path id=\"DejaVuSans-35\" d=\"M 691 4666 \n",
       "L 3169 4666 \n",
       "L 3169 4134 \n",
       "L 1269 4134 \n",
       "L 1269 2991 \n",
       "Q 1406 3038 1543 3061 \n",
       "Q 1681 3084 1819 3084 \n",
       "Q 2600 3084 3056 2656 \n",
       "Q 3513 2228 3513 1497 \n",
       "Q 3513 744 3044 326 \n",
       "Q 2575 -91 1722 -91 \n",
       "Q 1428 -91 1123 -41 \n",
       "Q 819 9 494 109 \n",
       "L 494 744 \n",
       "Q 775 591 1075 516 \n",
       "Q 1375 441 1709 441 \n",
       "Q 2250 441 2565 725 \n",
       "Q 2881 1009 2881 1497 \n",
       "Q 2881 1984 2565 2268 \n",
       "Q 2250 2553 1709 2553 \n",
       "Q 1456 2553 1204 2497 \n",
       "Q 953 2441 691 2322 \n",
       "L 691 4666 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-32\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-32\" x=\"127.246094\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"190.869141\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-2d\" x=\"254.492188\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"290.576172\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-31\" x=\"354.199219\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-2d\" x=\"417.822266\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-32\" x=\"453.90625\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-35\" x=\"517.529297\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_2\">\n",
       "     <g id=\"line2d_2\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#m4f136aa2f4\" x=\"184.103409\" y=\"339.84\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_2\">\n",
       "      <!-- 2020-02-04 -->\n",
       "      <g transform=\"translate(171.964192 400.968826) rotate(-60) scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path id=\"DejaVuSans-34\" d=\"M 2419 4116 \n",
       "L 825 1625 \n",
       "L 2419 1625 \n",
       "L 2419 4116 \n",
       "z\n",
       "M 2253 4666 \n",
       "L 3047 4666 \n",
       "L 3047 1625 \n",
       "L 3713 1625 \n",
       "L 3713 1100 \n",
       "L 3047 1100 \n",
       "L 3047 0 \n",
       "L 2419 0 \n",
       "L 2419 1100 \n",
       "L 313 1100 \n",
       "L 313 1709 \n",
       "L 2253 4666 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-32\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-32\" x=\"127.246094\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"190.869141\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-2d\" x=\"254.492188\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"290.576172\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-32\" x=\"354.199219\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-2d\" x=\"417.822266\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"453.90625\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-34\" x=\"517.529297\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_3\">\n",
       "     <g id=\"line2d_3\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#m4f136aa2f4\" x=\"296.830682\" y=\"339.84\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_3\">\n",
       "      <!-- 2020-02-14 -->\n",
       "      <g transform=\"translate(284.691464 400.968826) rotate(-60) scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-32\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-32\" x=\"127.246094\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"190.869141\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-2d\" x=\"254.492188\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"290.576172\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-32\" x=\"354.199219\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-2d\" x=\"417.822266\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-31\" x=\"453.90625\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-34\" x=\"517.529297\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_4\">\n",
       "     <g id=\"line2d_4\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#m4f136aa2f4\" x=\"409.557955\" y=\"339.84\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_4\">\n",
       "      <!-- 2020-02-24 -->\n",
       "      <g transform=\"translate(397.418737 400.968826) rotate(-60) scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-32\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-32\" x=\"127.246094\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"190.869141\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-2d\" x=\"254.492188\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"290.576172\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-32\" x=\"354.199219\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-2d\" x=\"417.822266\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-32\" x=\"453.90625\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-34\" x=\"517.529297\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_5\">\n",
       "     <g id=\"line2d_5\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#m4f136aa2f4\" x=\"522.285227\" y=\"339.84\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_5\">\n",
       "      <!-- 2020-03-05 -->\n",
       "      <g transform=\"translate(510.14601 400.968826) rotate(-60) scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path id=\"DejaVuSans-33\" d=\"M 2597 2516 \n",
       "Q 3050 2419 3304 2112 \n",
       "Q 3559 1806 3559 1356 \n",
       "Q 3559 666 3084 287 \n",
       "Q 2609 -91 1734 -91 \n",
       "Q 1441 -91 1130 -33 \n",
       "Q 819 25 488 141 \n",
       "L 488 750 \n",
       "Q 750 597 1062 519 \n",
       "Q 1375 441 1716 441 \n",
       "Q 2309 441 2620 675 \n",
       "Q 2931 909 2931 1356 \n",
       "Q 2931 1769 2642 2001 \n",
       "Q 2353 2234 1838 2234 \n",
       "L 1294 2234 \n",
       "L 1294 2753 \n",
       "L 1863 2753 \n",
       "Q 2328 2753 2575 2939 \n",
       "Q 2822 3125 2822 3475 \n",
       "Q 2822 3834 2567 4026 \n",
       "Q 2313 4219 1838 4219 \n",
       "Q 1578 4219 1281 4162 \n",
       "Q 984 4106 628 3988 \n",
       "L 628 4550 \n",
       "Q 988 4650 1302 4700 \n",
       "Q 1616 4750 1894 4750 \n",
       "Q 2613 4750 3031 4423 \n",
       "Q 3450 4097 3450 3541 \n",
       "Q 3450 3153 3228 2886 \n",
       "Q 3006 2619 2597 2516 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-32\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-32\" x=\"127.246094\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"190.869141\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-2d\" x=\"254.492188\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"290.576172\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-33\" x=\"354.199219\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-2d\" x=\"417.822266\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"453.90625\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-35\" x=\"517.529297\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"text_6\">\n",
       "     <!-- date -->\n",
       "     <g transform=\"translate(313.7375 413.607108) scale(0.1 -0.1)\">\n",
       "      <defs>\n",
       "       <path id=\"DejaVuSans-64\" d=\"M 2906 2969 \n",
       "L 2906 4863 \n",
       "L 3481 4863 \n",
       "L 3481 0 \n",
       "L 2906 0 \n",
       "L 2906 525 \n",
       "Q 2725 213 2448 61 \n",
       "Q 2172 -91 1784 -91 \n",
       "Q 1150 -91 751 415 \n",
       "Q 353 922 353 1747 \n",
       "Q 353 2572 751 3078 \n",
       "Q 1150 3584 1784 3584 \n",
       "Q 2172 3584 2448 3432 \n",
       "Q 2725 3281 2906 2969 \n",
       "z\n",
       "M 947 1747 \n",
       "Q 947 1113 1208 752 \n",
       "Q 1469 391 1925 391 \n",
       "Q 2381 391 2643 752 \n",
       "Q 2906 1113 2906 1747 \n",
       "Q 2906 2381 2643 2742 \n",
       "Q 2381 3103 1925 3103 \n",
       "Q 1469 3103 1208 2742 \n",
       "Q 947 2381 947 1747 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       <path id=\"DejaVuSans-61\" d=\"M 2194 1759 \n",
       "Q 1497 1759 1228 1600 \n",
       "Q 959 1441 959 1056 \n",
       "Q 959 750 1161 570 \n",
       "Q 1363 391 1709 391 \n",
       "Q 2188 391 2477 730 \n",
       "Q 2766 1069 2766 1631 \n",
       "L 2766 1759 \n",
       "L 2194 1759 \n",
       "z\n",
       "M 3341 1997 \n",
       "L 3341 0 \n",
       "L 2766 0 \n",
       "L 2766 531 \n",
       "Q 2569 213 2275 61 \n",
       "Q 1981 -91 1556 -91 \n",
       "Q 1019 -91 701 211 \n",
       "Q 384 513 384 1019 \n",
       "Q 384 1609 779 1909 \n",
       "Q 1175 2209 1959 2209 \n",
       "L 2766 2209 \n",
       "L 2766 2266 \n",
       "Q 2766 2663 2505 2880 \n",
       "Q 2244 3097 1772 3097 \n",
       "Q 1472 3097 1187 3025 \n",
       "Q 903 2953 641 2809 \n",
       "L 641 3341 \n",
       "Q 956 3463 1253 3523 \n",
       "Q 1550 3584 1831 3584 \n",
       "Q 2591 3584 2966 3190 \n",
       "Q 3341 2797 3341 1997 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       <path id=\"DejaVuSans-74\" d=\"M 1172 4494 \n",
       "L 1172 3500 \n",
       "L 2356 3500 \n",
       "L 2356 3053 \n",
       "L 1172 3053 \n",
       "L 1172 1153 \n",
       "Q 1172 725 1289 603 \n",
       "Q 1406 481 1766 481 \n",
       "L 2356 481 \n",
       "L 2356 0 \n",
       "L 1766 0 \n",
       "Q 1100 0 847 248 \n",
       "Q 594 497 594 1153 \n",
       "L 594 3053 \n",
       "L 172 3053 \n",
       "L 172 3500 \n",
       "L 594 3500 \n",
       "L 594 4494 \n",
       "L 1172 4494 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       <path id=\"DejaVuSans-65\" d=\"M 3597 1894 \n",
       "L 3597 1613 \n",
       "L 953 1613 \n",
       "Q 991 1019 1311 708 \n",
       "Q 1631 397 2203 397 \n",
       "Q 2534 397 2845 478 \n",
       "Q 3156 559 3463 722 \n",
       "L 3463 178 \n",
       "Q 3153 47 2828 -22 \n",
       "Q 2503 -91 2169 -91 \n",
       "Q 1331 -91 842 396 \n",
       "Q 353 884 353 1716 \n",
       "Q 353 2575 817 3079 \n",
       "Q 1281 3584 2069 3584 \n",
       "Q 2775 3584 3186 3129 \n",
       "Q 3597 2675 3597 1894 \n",
       "z\n",
       "M 3022 2063 \n",
       "Q 3016 2534 2758 2815 \n",
       "Q 2500 3097 2075 3097 \n",
       "Q 1594 3097 1305 2825 \n",
       "Q 1016 2553 972 2059 \n",
       "L 3022 2063 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "      </defs>\n",
       "      <use xlink:href=\"#DejaVuSans-64\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-61\" x=\"63.476562\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-74\" x=\"124.755859\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-65\" x=\"163.964844\"/>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_2\">\n",
       "    <g id=\"ytick_1\">\n",
       "     <g id=\"line2d_6\">\n",
       "      <defs>\n",
       "       <path id=\"m77791738d8\" d=\"M 0 0 \n",
       "L -3.5 0 \n",
       "\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </defs>\n",
       "      <g>\n",
       "       <use xlink:href=\"#m77791738d8\" x=\"46.0125\" y=\"324.759923\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_7\">\n",
       "      <!-- 0 -->\n",
       "      <g transform=\"translate(32.65 328.559142) scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_2\">\n",
       "     <g id=\"line2d_7\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#m77791738d8\" x=\"46.0125\" y=\"284.836496\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_8\">\n",
       "      <!-- 2000 -->\n",
       "      <g transform=\"translate(13.5625 288.635715) scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-32\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"127.246094\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"190.869141\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_3\">\n",
       "     <g id=\"line2d_8\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#m77791738d8\" x=\"46.0125\" y=\"244.913069\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_9\">\n",
       "      <!-- 4000 -->\n",
       "      <g transform=\"translate(13.5625 248.712288) scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-34\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"127.246094\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"190.869141\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_4\">\n",
       "     <g id=\"line2d_9\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#m77791738d8\" x=\"46.0125\" y=\"204.989642\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_10\">\n",
       "      <!-- 6000 -->\n",
       "      <g transform=\"translate(13.5625 208.78886) scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path id=\"DejaVuSans-36\" d=\"M 2113 2584 \n",
       "Q 1688 2584 1439 2293 \n",
       "Q 1191 2003 1191 1497 \n",
       "Q 1191 994 1439 701 \n",
       "Q 1688 409 2113 409 \n",
       "Q 2538 409 2786 701 \n",
       "Q 3034 994 3034 1497 \n",
       "Q 3034 2003 2786 2293 \n",
       "Q 2538 2584 2113 2584 \n",
       "z\n",
       "M 3366 4563 \n",
       "L 3366 3988 \n",
       "Q 3128 4100 2886 4159 \n",
       "Q 2644 4219 2406 4219 \n",
       "Q 1781 4219 1451 3797 \n",
       "Q 1122 3375 1075 2522 \n",
       "Q 1259 2794 1537 2939 \n",
       "Q 1816 3084 2150 3084 \n",
       "Q 2853 3084 3261 2657 \n",
       "Q 3669 2231 3669 1497 \n",
       "Q 3669 778 3244 343 \n",
       "Q 2819 -91 2113 -91 \n",
       "Q 1303 -91 875 529 \n",
       "Q 447 1150 447 2328 \n",
       "Q 447 3434 972 4092 \n",
       "Q 1497 4750 2381 4750 \n",
       "Q 2619 4750 2861 4703 \n",
       "Q 3103 4656 3366 4563 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-36\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"127.246094\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"190.869141\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_5\">\n",
       "     <g id=\"line2d_10\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#m77791738d8\" x=\"46.0125\" y=\"165.066214\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_11\">\n",
       "      <!-- 8000 -->\n",
       "      <g transform=\"translate(13.5625 168.865433) scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path id=\"DejaVuSans-38\" d=\"M 2034 2216 \n",
       "Q 1584 2216 1326 1975 \n",
       "Q 1069 1734 1069 1313 \n",
       "Q 1069 891 1326 650 \n",
       "Q 1584 409 2034 409 \n",
       "Q 2484 409 2743 651 \n",
       "Q 3003 894 3003 1313 \n",
       "Q 3003 1734 2745 1975 \n",
       "Q 2488 2216 2034 2216 \n",
       "z\n",
       "M 1403 2484 \n",
       "Q 997 2584 770 2862 \n",
       "Q 544 3141 544 3541 \n",
       "Q 544 4100 942 4425 \n",
       "Q 1341 4750 2034 4750 \n",
       "Q 2731 4750 3128 4425 \n",
       "Q 3525 4100 3525 3541 \n",
       "Q 3525 3141 3298 2862 \n",
       "Q 3072 2584 2669 2484 \n",
       "Q 3125 2378 3379 2068 \n",
       "Q 3634 1759 3634 1313 \n",
       "Q 3634 634 3220 271 \n",
       "Q 2806 -91 2034 -91 \n",
       "Q 1263 -91 848 271 \n",
       "Q 434 634 434 1313 \n",
       "Q 434 1759 690 2068 \n",
       "Q 947 2378 1403 2484 \n",
       "z\n",
       "M 1172 3481 \n",
       "Q 1172 3119 1398 2916 \n",
       "Q 1625 2713 2034 2713 \n",
       "Q 2441 2713 2670 2916 \n",
       "Q 2900 3119 2900 3481 \n",
       "Q 2900 3844 2670 4047 \n",
       "Q 2441 4250 2034 4250 \n",
       "Q 1625 4250 1398 4047 \n",
       "Q 1172 3844 1172 3481 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-38\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"127.246094\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"190.869141\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_6\">\n",
       "     <g id=\"line2d_11\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#m77791738d8\" x=\"46.0125\" y=\"125.142787\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_12\">\n",
       "      <!-- 10000 -->\n",
       "      <g transform=\"translate(7.2 128.942006) scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-31\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"127.246094\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"190.869141\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"254.492188\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_7\">\n",
       "     <g id=\"line2d_12\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#m77791738d8\" x=\"46.0125\" y=\"85.21936\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_13\">\n",
       "      <!-- 12000 -->\n",
       "      <g transform=\"translate(7.2 89.018578) scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-31\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-32\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"127.246094\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"190.869141\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"254.492188\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_8\">\n",
       "     <g id=\"line2d_13\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#m77791738d8\" x=\"46.0125\" y=\"45.295932\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_14\">\n",
       "      <!-- 14000 -->\n",
       "      <g transform=\"translate(7.2 49.095151) scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-31\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-34\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"127.246094\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"190.869141\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"254.492188\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"line2d_14\">\n",
       "    <path d=\"M 71.376136 315.63742 \n",
       "L 82.648864 311.026264 \n",
       "L 93.921591 309.409366 \n",
       "L 105.194318 289.407729 \n",
       "L 116.467045 295.635783 \n",
       "L 127.739773 290.086427 \n",
       "L 139.0125 285.215769 \n",
       "L 150.285227 282.860286 \n",
       "L 161.557955 273.079047 \n",
       "L 172.830682 268.368082 \n",
       "L 184.103409 260.223703 \n",
       "L 195.376136 247.188704 \n",
       "L 206.648864 251.021353 \n",
       "L 217.921591 262.020257 \n",
       "L 229.194318 257.189523 \n",
       "L 240.467045 271.821459 \n",
       "L 251.739773 265.413749 \n",
       "L 263.0125 275.514376 \n",
       "L 274.285227 284.53707 \n",
       "L 285.557955 22.32 \n",
       "L 296.830682 243.974868 \n",
       "L 308.103409 272.041038 \n",
       "L 319.376136 284.676802 \n",
       "L 330.648864 283.878334 \n",
       "L 341.921591 287.072208 \n",
       "L 353.194318 289.846886 \n",
       "L 364.467045 316.954893 \n",
       "L 375.739773 307.01396 \n",
       "L 387.0125 308.331433 \n",
       "L 398.285227 311.824733 \n",
       "L 409.557955 320.488117 \n",
       "L 420.830682 314.619373 \n",
       "L 432.103409 316.655468 \n",
       "L 443.376136 316.116501 \n",
       "L 454.648864 318.232443 \n",
       "L 465.921591 316.236272 \n",
       "L 477.194318 313.321862 \n",
       "L 488.467045 320.727657 \n",
       "L 499.739773 322.264709 \n",
       "L 511.0125 322.38448 \n",
       "L 522.285227 321.985245 \n",
       "L 533.557955 321.905398 \n",
       "L 544.830682 322.783714 \n",
       "L 556.103409 323.881608 \n",
       "L 567.376136 323.961455 \n",
       "L 578.648864 324.380651 \n",
       "\" clip-path=\"url(#p02d258b4c5)\" style=\"fill: none; stroke: #1f77b4; stroke-width: 1.5; stroke-linecap: square\"/>\n",
       "   </g>\n",
       "   <g id=\"line2d_15\">\n",
       "    <path d=\"M 71.376136 324.680077 \n",
       "L 82.648864 324.540345 \n",
       "L 93.921591 324.72 \n",
       "L 105.194318 324.580268 \n",
       "L 116.467045 323.90157 \n",
       "L 127.739773 324.340727 \n",
       "L 139.0125 323.821723 \n",
       "L 150.285227 323.003293 \n",
       "L 161.557955 323.382565 \n",
       "L 172.830682 321.825552 \n",
       "L 184.103409 321.625934 \n",
       "L 195.376136 319.569878 \n",
       "L 206.648864 319.549916 \n",
       "L 217.921591 317.03474 \n",
       "L 229.194318 314.579449 \n",
       "L 240.467045 312.802857 \n",
       "L 251.739773 312.14412 \n",
       "L 263.0125 310.487298 \n",
       "L 274.285227 309.908408 \n",
       "L 285.557955 301.384757 \n",
       "L 296.830682 308.551012 \n",
       "L 308.103409 297.352491 \n",
       "L 319.376136 298.350576 \n",
       "L 330.648864 296.314481 \n",
       "L 341.921591 290.665317 \n",
       "L 353.194318 288.349758 \n",
       "L 364.467045 289.248035 \n",
       "L 375.739773 282.660669 \n",
       "L 387.0125 276.951619 \n",
       "L 398.285227 280.265264 \n",
       "L 409.557955 287.9106 \n",
       "L 420.830682 273.079047 \n",
       "L 432.103409 276.412653 \n",
       "L 443.376136 269.865211 \n",
       "L 454.648864 252.458597 \n",
       "L 465.921591 267.17038 \n",
       "L 477.194318 272.400349 \n",
       "L 488.467045 268.128542 \n",
       "L 499.739773 270.024905 \n",
       "L 511.0125 271.821459 \n",
       "L 522.285227 281.063732 \n",
       "L 533.557955 291.204283 \n",
       "L 544.830682 291.264168 \n",
       "L 556.103409 291.603517 \n",
       "L 567.376136 294.118693 \n",
       "L 578.648864 298.869581 \n",
       "\" clip-path=\"url(#p02d258b4c5)\" style=\"fill: none; stroke: #ff7f0e; stroke-width: 1.5; stroke-linecap: square\"/>\n",
       "   </g>\n",
       "   <g id=\"line2d_16\">\n",
       "    <path d=\"M 71.376136 324.440536 \n",
       "L 82.648864 324.460498 \n",
       "L 93.921591 324.280842 \n",
       "L 105.194318 324.240919 \n",
       "L 116.467045 324.240919 \n",
       "L 127.739773 324.001378 \n",
       "L 139.0125 323.90157 \n",
       "L 150.285227 324.161072 \n",
       "L 161.557955 323.542259 \n",
       "L 172.830682 323.622106 \n",
       "L 184.103409 323.482374 \n",
       "L 195.376136 323.462412 \n",
       "L 206.648864 323.302718 \n",
       "L 217.921591 323.302718 \n",
       "L 229.194318 323.043216 \n",
       "L 240.467045 322.983331 \n",
       "L 251.739773 322.823637 \n",
       "L 263.0125 322.604058 \n",
       "L 274.285227 322.823637 \n",
       "L 285.557955 319.689648 \n",
       "L 296.830682 324.500421 \n",
       "L 308.103409 321.905398 \n",
       "L 319.376136 321.92536 \n",
       "L 330.648864 322.663943 \n",
       "L 341.921591 322.803675 \n",
       "L 353.194318 322.04513 \n",
       "L 364.467045 322.484288 \n",
       "L 375.739773 322.404441 \n",
       "L 387.0125 322.584097 \n",
       "L 398.285227 322.823637 \n",
       "L 409.557955 321.765666 \n",
       "L 420.830682 323.342642 \n",
       "L 432.103409 323.721914 \n",
       "L 443.376136 324.181034 \n",
       "L 454.648864 323.881608 \n",
       "L 465.921591 323.821723 \n",
       "L 477.194318 324.061263 \n",
       "L 488.467045 323.921531 \n",
       "L 499.739773 324.14111 \n",
       "L 511.0125 324.001378 \n",
       "L 522.285227 324.14111 \n",
       "L 533.557955 324.161072 \n",
       "L 544.830682 324.200995 \n",
       "L 556.103409 324.220957 \n",
       "L 567.376136 324.320766 \n",
       "L 578.648864 324.420574 \n",
       "\" clip-path=\"url(#p02d258b4c5)\" style=\"fill: none; stroke: #2ca02c; stroke-width: 1.5; stroke-linecap: square\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_3\">\n",
       "    <path d=\"M 46.0125 339.84 \n",
       "L 46.0125 7.2 \n",
       "\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_4\">\n",
       "    <path d=\"M 604.0125 339.84 \n",
       "L 604.0125 7.2 \n",
       "\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_5\">\n",
       "    <path d=\"M 46.0125 339.84 \n",
       "L 604.0125 339.84 \n",
       "\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_6\">\n",
       "    <path d=\"M 46.0125 7.2 \n",
       "L 604.0125 7.2 \n",
       "\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n",
       "   </g>\n",
       "   <g id=\"legend_1\">\n",
       "    <g id=\"patch_7\">\n",
       "     <path d=\"M 487.165625 60.06875 \n",
       "L 597.0125 60.06875 \n",
       "Q 599.0125 60.06875 599.0125 58.06875 \n",
       "L 599.0125 14.2 \n",
       "Q 599.0125 12.2 597.0125 12.2 \n",
       "L 487.165625 12.2 \n",
       "Q 485.165625 12.2 485.165625 14.2 \n",
       "L 485.165625 58.06875 \n",
       "Q 485.165625 60.06875 487.165625 60.06875 \n",
       "z\n",
       "\" style=\"fill: #ffffff; opacity: 0.8; stroke: #cccccc; stroke-linejoin: miter\"/>\n",
       "    </g>\n",
       "    <g id=\"line2d_17\">\n",
       "     <path d=\"M 489.165625 20.298438 \n",
       "L 499.165625 20.298438 \n",
       "L 509.165625 20.298438 \n",
       "\" style=\"fill: none; stroke: #1f77b4; stroke-width: 1.5; stroke-linecap: square\"/>\n",
       "    </g>\n",
       "    <g id=\"text_15\">\n",
       "     <!-- confirmed_num -->\n",
       "     <g transform=\"translate(517.165625 23.798438) scale(0.1 -0.1)\">\n",
       "      <defs>\n",
       "       <path id=\"DejaVuSans-63\" d=\"M 3122 3366 \n",
       "L 3122 2828 \n",
       "Q 2878 2963 2633 3030 \n",
       "Q 2388 3097 2138 3097 \n",
       "Q 1578 3097 1268 2742 \n",
       "Q 959 2388 959 1747 \n",
       "Q 959 1106 1268 751 \n",
       "Q 1578 397 2138 397 \n",
       "Q 2388 397 2633 464 \n",
       "Q 2878 531 3122 666 \n",
       "L 3122 134 \n",
       "Q 2881 22 2623 -34 \n",
       "Q 2366 -91 2075 -91 \n",
       "Q 1284 -91 818 406 \n",
       "Q 353 903 353 1747 \n",
       "Q 353 2603 823 3093 \n",
       "Q 1294 3584 2113 3584 \n",
       "Q 2378 3584 2631 3529 \n",
       "Q 2884 3475 3122 3366 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       <path id=\"DejaVuSans-6f\" d=\"M 1959 3097 \n",
       "Q 1497 3097 1228 2736 \n",
       "Q 959 2375 959 1747 \n",
       "Q 959 1119 1226 758 \n",
       "Q 1494 397 1959 397 \n",
       "Q 2419 397 2687 759 \n",
       "Q 2956 1122 2956 1747 \n",
       "Q 2956 2369 2687 2733 \n",
       "Q 2419 3097 1959 3097 \n",
       "z\n",
       "M 1959 3584 \n",
       "Q 2709 3584 3137 3096 \n",
       "Q 3566 2609 3566 1747 \n",
       "Q 3566 888 3137 398 \n",
       "Q 2709 -91 1959 -91 \n",
       "Q 1206 -91 779 398 \n",
       "Q 353 888 353 1747 \n",
       "Q 353 2609 779 3096 \n",
       "Q 1206 3584 1959 3584 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       <path id=\"DejaVuSans-6e\" d=\"M 3513 2113 \n",
       "L 3513 0 \n",
       "L 2938 0 \n",
       "L 2938 2094 \n",
       "Q 2938 2591 2744 2837 \n",
       "Q 2550 3084 2163 3084 \n",
       "Q 1697 3084 1428 2787 \n",
       "Q 1159 2491 1159 1978 \n",
       "L 1159 0 \n",
       "L 581 0 \n",
       "L 581 3500 \n",
       "L 1159 3500 \n",
       "L 1159 2956 \n",
       "Q 1366 3272 1645 3428 \n",
       "Q 1925 3584 2291 3584 \n",
       "Q 2894 3584 3203 3211 \n",
       "Q 3513 2838 3513 2113 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       <path id=\"DejaVuSans-66\" d=\"M 2375 4863 \n",
       "L 2375 4384 \n",
       "L 1825 4384 \n",
       "Q 1516 4384 1395 4259 \n",
       "Q 1275 4134 1275 3809 \n",
       "L 1275 3500 \n",
       "L 2222 3500 \n",
       "L 2222 3053 \n",
       "L 1275 3053 \n",
       "L 1275 0 \n",
       "L 697 0 \n",
       "L 697 3053 \n",
       "L 147 3053 \n",
       "L 147 3500 \n",
       "L 697 3500 \n",
       "L 697 3744 \n",
       "Q 697 4328 969 4595 \n",
       "Q 1241 4863 1831 4863 \n",
       "L 2375 4863 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       <path id=\"DejaVuSans-69\" d=\"M 603 3500 \n",
       "L 1178 3500 \n",
       "L 1178 0 \n",
       "L 603 0 \n",
       "L 603 3500 \n",
       "z\n",
       "M 603 4863 \n",
       "L 1178 4863 \n",
       "L 1178 4134 \n",
       "L 603 4134 \n",
       "L 603 4863 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       <path id=\"DejaVuSans-72\" d=\"M 2631 2963 \n",
       "Q 2534 3019 2420 3045 \n",
       "Q 2306 3072 2169 3072 \n",
       "Q 1681 3072 1420 2755 \n",
       "Q 1159 2438 1159 1844 \n",
       "L 1159 0 \n",
       "L 581 0 \n",
       "L 581 3500 \n",
       "L 1159 3500 \n",
       "L 1159 2956 \n",
       "Q 1341 3275 1631 3429 \n",
       "Q 1922 3584 2338 3584 \n",
       "Q 2397 3584 2469 3576 \n",
       "Q 2541 3569 2628 3553 \n",
       "L 2631 2963 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       <path id=\"DejaVuSans-6d\" d=\"M 3328 2828 \n",
       "Q 3544 3216 3844 3400 \n",
       "Q 4144 3584 4550 3584 \n",
       "Q 5097 3584 5394 3201 \n",
       "Q 5691 2819 5691 2113 \n",
       "L 5691 0 \n",
       "L 5113 0 \n",
       "L 5113 2094 \n",
       "Q 5113 2597 4934 2840 \n",
       "Q 4756 3084 4391 3084 \n",
       "Q 3944 3084 3684 2787 \n",
       "Q 3425 2491 3425 1978 \n",
       "L 3425 0 \n",
       "L 2847 0 \n",
       "L 2847 2094 \n",
       "Q 2847 2600 2669 2842 \n",
       "Q 2491 3084 2119 3084 \n",
       "Q 1678 3084 1418 2786 \n",
       "Q 1159 2488 1159 1978 \n",
       "L 1159 0 \n",
       "L 581 0 \n",
       "L 581 3500 \n",
       "L 1159 3500 \n",
       "L 1159 2956 \n",
       "Q 1356 3278 1631 3431 \n",
       "Q 1906 3584 2284 3584 \n",
       "Q 2666 3584 2933 3390 \n",
       "Q 3200 3197 3328 2828 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       <path id=\"DejaVuSans-5f\" d=\"M 3263 -1063 \n",
       "L 3263 -1509 \n",
       "L -63 -1509 \n",
       "L -63 -1063 \n",
       "L 3263 -1063 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       <path id=\"DejaVuSans-75\" d=\"M 544 1381 \n",
       "L 544 3500 \n",
       "L 1119 3500 \n",
       "L 1119 1403 \n",
       "Q 1119 906 1312 657 \n",
       "Q 1506 409 1894 409 \n",
       "Q 2359 409 2629 706 \n",
       "Q 2900 1003 2900 1516 \n",
       "L 2900 3500 \n",
       "L 3475 3500 \n",
       "L 3475 0 \n",
       "L 2900 0 \n",
       "L 2900 538 \n",
       "Q 2691 219 2414 64 \n",
       "Q 2138 -91 1772 -91 \n",
       "Q 1169 -91 856 284 \n",
       "Q 544 659 544 1381 \n",
       "z\n",
       "M 1991 3584 \n",
       "L 1991 3584 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "      </defs>\n",
       "      <use xlink:href=\"#DejaVuSans-63\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-6f\" x=\"54.980469\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-6e\" x=\"116.162109\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-66\" x=\"179.541016\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-69\" x=\"214.746094\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-72\" x=\"242.529297\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-6d\" x=\"281.892578\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-65\" x=\"379.304688\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-64\" x=\"440.828125\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-5f\" x=\"504.304688\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-6e\" x=\"554.304688\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-75\" x=\"617.683594\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-6d\" x=\"681.0625\"/>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"line2d_18\">\n",
       "     <path d=\"M 489.165625 35.254688 \n",
       "L 499.165625 35.254688 \n",
       "L 509.165625 35.254688 \n",
       "\" style=\"fill: none; stroke: #ff7f0e; stroke-width: 1.5; stroke-linecap: square\"/>\n",
       "    </g>\n",
       "    <g id=\"text_16\">\n",
       "     <!-- cured_num -->\n",
       "     <g transform=\"translate(517.165625 38.754688) scale(0.1 -0.1)\">\n",
       "      <use xlink:href=\"#DejaVuSans-63\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-75\" x=\"54.980469\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-72\" x=\"118.359375\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-65\" x=\"157.222656\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-64\" x=\"218.746094\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-5f\" x=\"282.222656\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-6e\" x=\"332.222656\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-75\" x=\"395.601562\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-6d\" x=\"458.980469\"/>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"line2d_19\">\n",
       "     <path d=\"M 489.165625 50.210938 \n",
       "L 499.165625 50.210938 \n",
       "L 509.165625 50.210938 \n",
       "\" style=\"fill: none; stroke: #2ca02c; stroke-width: 1.5; stroke-linecap: square\"/>\n",
       "    </g>\n",
       "    <g id=\"text_17\">\n",
       "     <!-- dead_num -->\n",
       "     <g transform=\"translate(517.165625 53.710938) scale(0.1 -0.1)\">\n",
       "      <use xlink:href=\"#DejaVuSans-64\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-65\" x=\"63.476562\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-61\" x=\"125\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-64\" x=\"186.279297\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-5f\" x=\"249.755859\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-6e\" x=\"299.755859\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-75\" x=\"363.134766\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-6d\" x=\"426.513672\"/>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "  </g>\n",
       " </g>\n",
       " <defs>\n",
       "  <clipPath id=\"p02d258b4c5\">\n",
       "   <rect x=\"46.0125\" y=\"7.2\" width=\"558\" height=\"332.64\"/>\n",
       "  </clipPath>\n",
       " </defs>\n",
       "</svg>\n"
      ],
      "text/plain": [
       "<Figure size 1000x600 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    }
   ],
   "source": [
    "dfdata = df.set_index(\"date\")\n",
    "dfdiff = dfdata.diff(periods=1).dropna()\n",
    "dfdiff = dfdiff.reset_index(\"date\")\n",
    "\n",
    "dfdiff.plot(x = \"date\",y = [\"confirmed_num\",\"cured_num\",\"dead_num\"],figsize=(10,6))\n",
    "plt.xticks(rotation=60)\n",
    "dfdiff = dfdiff.drop(\"date\",axis = 1).astype(\"float32\")\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "id": "8cb89487",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>confirmed_num</th>\n",
       "      <th>cured_num</th>\n",
       "      <th>dead_num</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>0</th>\n",
       "      <td>457.0</td>\n",
       "      <td>4.0</td>\n",
       "      <td>16.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>1</th>\n",
       "      <td>688.0</td>\n",
       "      <td>11.0</td>\n",
       "      <td>15.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>2</th>\n",
       "      <td>769.0</td>\n",
       "      <td>2.0</td>\n",
       "      <td>24.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>3</th>\n",
       "      <td>1771.0</td>\n",
       "      <td>9.0</td>\n",
       "      <td>26.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>4</th>\n",
       "      <td>1459.0</td>\n",
       "      <td>43.0</td>\n",
       "      <td>26.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "   confirmed_num  cured_num  dead_num\n",
       "0          457.0        4.0      16.0\n",
       "1          688.0       11.0      15.0\n",
       "2          769.0        2.0      24.0\n",
       "3         1771.0        9.0      26.0\n",
       "4         1459.0       43.0      26.0"
      ]
     },
     "execution_count": 5,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dfdiff.head()"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "15dc30a0",
   "metadata": {},
   "source": [
    "下面我们通过继承torch.utils.data.Dataset实现自定义时间序列数据集。\n",
    "\n",
    "torch.utils.data.Dataset是一个抽象类，用户想要加载自定义的数据只需要继承这个类，并且覆写其中的两个方法即可：\n",
    "\n",
    "* `__len__`:实现len(dataset)返回整个数据集的大小。\n",
    "* `__getitem__`:用来获取一些索引的数据，使`dataset[i]`返回数据集中第i个样本。\n",
    "\n",
    "不覆写这两个方法会直接返回错误。\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 6,
   "id": "d654bf5d",
   "metadata": {},
   "outputs": [],
   "source": [
    "import torch \n",
    "from torch import nn \n",
    "from torch.utils.data import Dataset,DataLoader,TensorDataset\n",
    "\n",
    "\n",
    "#用某日前8天窗口数据作为输入预测该日数据\n",
    "WINDOW_SIZE = 8\n",
    "\n",
    "class Covid19Dataset(Dataset):\n",
    "        \n",
    "    def __len__(self):\n",
    "        return len(dfdiff) - WINDOW_SIZE\n",
    "    \n",
    "    def __getitem__(self,i):\n",
    "        x = dfdiff.loc[i:i+WINDOW_SIZE-1,:]\n",
    "        feature = torch.tensor(x.values)\n",
    "        y = dfdiff.loc[i+WINDOW_SIZE,:]\n",
    "        label = torch.tensor(y.values)\n",
    "        return (feature,label)\n",
    "    \n",
    "ds_train = Covid19Dataset()\n",
    "\n",
    "#数据较小，可以将全部训练数据放入到一个batch中，提升性能\n",
    "dl_train = DataLoader(ds_train,batch_size = 38)\n",
    "\n",
    "for features,labels in dl_train:\n",
    "    break \n",
    "    \n",
    "#dl_train同时作为验证集\n",
    "dl_val = dl_train\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "3f1410eb",
   "metadata": {},
   "source": [
    "## 二，定义模型"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "1b39abea",
   "metadata": {},
   "source": [
    "使用Pytorch通常有三种方式构建模型：使用nn.Sequential按层顺序构建模型，继承nn.Module基类构建自定义模型，继承nn.Module基类构建模型并辅助应用模型容器进行封装。\n",
    "\n",
    "此处选择第二种方式构建模型。\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 39,
   "id": "42466f8b",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Net(\n",
      "  (lstm): LSTM(3, 3, num_layers=5, batch_first=True)\n",
      "  (linear): Linear(in_features=3, out_features=3, bias=True)\n",
      "  (block): Block()\n",
      ")\n"
     ]
    }
   ],
   "source": [
    "import torch\n",
    "from torch import nn \n",
    "import importlib \n",
    "import torchkeras \n",
    "\n",
    "torch.random.seed()\n",
    "\n",
    "class Block(nn.Module):\n",
    "    def __init__(self):\n",
    "        super(Block,self).__init__()\n",
    "    \n",
    "    def forward(self,x,x_input):\n",
    "        x_out = torch.max((1+x)*x_input[:,-1,:],torch.tensor(0.0))\n",
    "        return x_out\n",
    "    \n",
    "class Net(nn.Module):\n",
    "    def __init__(self):\n",
    "        super(Net, self).__init__()\n",
    "        # 3层lstm\n",
    "        self.lstm = nn.LSTM(input_size = 3,hidden_size = 3,num_layers = 5,batch_first = True)\n",
    "        self.linear = nn.Linear(3,3)\n",
    "        self.block = Block()\n",
    "        \n",
    "    def forward(self,x_input):\n",
    "        x = self.lstm(x_input)[0][:,-1,:]\n",
    "        x = self.linear(x)\n",
    "        y = self.block(x,x_input)\n",
    "        return y\n",
    "        \n",
    "net = Net()\n",
    "print(net)\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 40,
   "id": "e02fe265",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "--------------------------------------------------------------------------\n",
      "Layer (type)                            Output Shape              Param #\n",
      "==========================================================================\n",
      "LSTM-1                                    [-1, 8, 3]                  480\n",
      "Linear-2                                     [-1, 3]                   12\n",
      "Block-3                                      [-1, 3]                    0\n",
      "==========================================================================\n",
      "Total params: 492\n",
      "Trainable params: 492\n",
      "Non-trainable params: 0\n",
      "--------------------------------------------------------------------------\n",
      "Input size (MB): 0.000076\n",
      "Forward/backward pass size (MB): 0.000229\n",
      "Params size (MB): 0.001877\n",
      "Estimated Total Size (MB): 0.002182\n",
      "--------------------------------------------------------------------------\n"
     ]
    }
   ],
   "source": [
    "from torchkeras import summary\n",
    "summary(net,input_data=features);"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "4649f9f5",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "id": "4d8d90bc",
   "metadata": {},
   "source": [
    "### 三，训练模型"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "39722b11",
   "metadata": {},
   "source": [
    "训练Pytorch通常需要用户编写自定义训练循环，训练循环的代码风格因人而异。\n",
    "\n",
    "有3类典型的训练循环代码风格：脚本形式训练循环，函数形式训练循环，类形式训练循环。\n",
    "\n",
    "此处我们通过引入torchkeras库中的KerasModel工具来训练模型，无需编写自定义循环。\n",
    "\n",
    "torchkeras详情:  https://github.com/lyhue1991/torchkeras \n",
    "\n",
    "注：循环神经网络调试较为困难，需要设置多个不同的学习率多次尝试，以取得较好的效果。\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 42,
   "id": "fd846cf3-8a65-4cbf-8bc9-ba28c6eed841",
   "metadata": {},
   "outputs": [],
   "source": [
    "from torchmetrics.regression import MeanAbsolutePercentageError\n",
    "\n",
    "def mspe(y_pred,y_true):\n",
    "    err_percent = (y_true - y_pred)**2/(torch.max(y_true**2,torch.tensor(1e-7)))\n",
    "    return torch.mean(err_percent)\n",
    "\n",
    "net = Net() \n",
    "loss_fn = mspe\n",
    "metric_dict = {\"mape\":MeanAbsolutePercentageError()}\n",
    "\n",
    "optimizer = torch.optim.Adam(net.parameters(), lr=0.01)\n",
    "lr_scheduler = torch.optim.lr_scheduler.StepLR(optimizer, step_size=10, gamma=0.0001)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 43,
   "id": "9bfa7af9-ab5f-4fa5-bc61-3e1cd77cc087",
   "metadata": {},
   "outputs": [],
   "source": [
    "from torchkeras import KerasModel \n",
    "keras_model = KerasModel(net,\n",
    "       loss_fn = loss_fn,\n",
    "       metrics_dict= metric_dict,\n",
    "       optimizer = optimizer,\n",
    "       lr_scheduler = lr_scheduler) \n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 44,
   "id": "d8185438",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\u001b[0;31m<<<<<< 🐌 cpu is used >>>>>>\u001b[0m\n"
     ]
    },
    {
     "data": {
      "image/svg+xml": [
       "<?xml version=\"1.0\" encoding=\"utf-8\" standalone=\"no\"?>\n",
       "<!DOCTYPE svg PUBLIC \"-//W3C//DTD SVG 1.1//EN\"\n",
       "  \"http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd\">\n",
       "<svg xmlns:xlink=\"http://www.w3.org/1999/xlink\" width=\"385.78125pt\" height=\"281.634375pt\" viewBox=\"0 0 385.78125 281.634375\" xmlns=\"http://www.w3.org/2000/svg\" version=\"1.1\">\n",
       " <metadata>\n",
       "  <rdf:RDF xmlns:dc=\"http://purl.org/dc/elements/1.1/\" xmlns:cc=\"http://creativecommons.org/ns#\" xmlns:rdf=\"http://www.w3.org/1999/02/22-rdf-syntax-ns#\">\n",
       "   <cc:Work>\n",
       "    <dc:type rdf:resource=\"http://purl.org/dc/dcmitype/StillImage\"/>\n",
       "    <dc:date>2024-09-11T11:24:09.189707</dc:date>\n",
       "    <dc:format>image/svg+xml</dc:format>\n",
       "    <dc:creator>\n",
       "     <cc:Agent>\n",
       "      <dc:title>Matplotlib v3.9.2, https://matplotlib.org/</dc:title>\n",
       "     </cc:Agent>\n",
       "    </dc:creator>\n",
       "   </cc:Work>\n",
       "  </rdf:RDF>\n",
       " </metadata>\n",
       " <defs>\n",
       "  <style type=\"text/css\">*{stroke-linejoin: round; stroke-linecap: butt}</style>\n",
       " </defs>\n",
       " <g id=\"figure_1\">\n",
       "  <g id=\"patch_1\">\n",
       "   <path d=\"M 0 281.634375 \n",
       "L 385.78125 281.634375 \n",
       "L 385.78125 0 \n",
       "L 0 0 \n",
       "z\n",
       "\" style=\"fill: #ffffff\"/>\n",
       "  </g>\n",
       "  <g id=\"axes_1\">\n",
       "   <g id=\"patch_2\">\n",
       "    <path d=\"M 43.78125 244.078125 \n",
       "L 378.58125 244.078125 \n",
       "L 378.58125 22.318125 \n",
       "L 43.78125 22.318125 \n",
       "z\n",
       "\" style=\"fill: #ffffff\"/>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_1\">\n",
       "    <g id=\"xtick_1\">\n",
       "     <g id=\"line2d_1\">\n",
       "      <defs>\n",
       "       <path id=\"mcb4a81abfa\" d=\"M 0 0 \n",
       "L 0 3.5 \n",
       "\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </defs>\n",
       "      <g>\n",
       "       <use xlink:href=\"#mcb4a81abfa\" x=\"48.504134\" y=\"244.078125\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_1\">\n",
       "      <!-- 0 -->\n",
       "      <g transform=\"translate(45.322884 258.676562) scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path id=\"DejaVuSans-30\" d=\"M 2034 4250 \n",
       "Q 1547 4250 1301 3770 \n",
       "Q 1056 3291 1056 2328 \n",
       "Q 1056 1369 1301 889 \n",
       "Q 1547 409 2034 409 \n",
       "Q 2525 409 2770 889 \n",
       "Q 3016 1369 3016 2328 \n",
       "Q 3016 3291 2770 3770 \n",
       "Q 2525 4250 2034 4250 \n",
       "z\n",
       "M 2034 4750 \n",
       "Q 2819 4750 3233 4129 \n",
       "Q 3647 3509 3647 2328 \n",
       "Q 3647 1150 3233 529 \n",
       "Q 2819 -91 2034 -91 \n",
       "Q 1250 -91 836 529 \n",
       "Q 422 1150 422 2328 \n",
       "Q 422 3509 836 4129 \n",
       "Q 1250 4750 2034 4750 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-30\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_2\">\n",
       "     <g id=\"line2d_2\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#mcb4a81abfa\" x=\"100.980623\" y=\"244.078125\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_2\">\n",
       "      <!-- 5 -->\n",
       "      <g transform=\"translate(97.799373 258.676562) scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path id=\"DejaVuSans-35\" d=\"M 691 4666 \n",
       "L 3169 4666 \n",
       "L 3169 4134 \n",
       "L 1269 4134 \n",
       "L 1269 2991 \n",
       "Q 1406 3038 1543 3061 \n",
       "Q 1681 3084 1819 3084 \n",
       "Q 2600 3084 3056 2656 \n",
       "Q 3513 2228 3513 1497 \n",
       "Q 3513 744 3044 326 \n",
       "Q 2575 -91 1722 -91 \n",
       "Q 1428 -91 1123 -41 \n",
       "Q 819 9 494 109 \n",
       "L 494 744 \n",
       "Q 775 591 1075 516 \n",
       "Q 1375 441 1709 441 \n",
       "Q 2250 441 2565 725 \n",
       "Q 2881 1009 2881 1497 \n",
       "Q 2881 1984 2565 2268 \n",
       "Q 2250 2553 1709 2553 \n",
       "Q 1456 2553 1204 2497 \n",
       "Q 953 2441 691 2322 \n",
       "L 691 4666 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-35\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_3\">\n",
       "     <g id=\"line2d_3\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#mcb4a81abfa\" x=\"153.457112\" y=\"244.078125\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_3\">\n",
       "      <!-- 10 -->\n",
       "      <g transform=\"translate(147.094612 258.676562) scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path id=\"DejaVuSans-31\" d=\"M 794 531 \n",
       "L 1825 531 \n",
       "L 1825 4091 \n",
       "L 703 3866 \n",
       "L 703 4441 \n",
       "L 1819 4666 \n",
       "L 2450 4666 \n",
       "L 2450 531 \n",
       "L 3481 531 \n",
       "L 3481 0 \n",
       "L 794 0 \n",
       "L 794 531 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-31\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"63.623047\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_4\">\n",
       "     <g id=\"line2d_4\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#mcb4a81abfa\" x=\"205.933601\" y=\"244.078125\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_4\">\n",
       "      <!-- 15 -->\n",
       "      <g transform=\"translate(199.571101 258.676562) scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-31\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-35\" x=\"63.623047\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_5\">\n",
       "     <g id=\"line2d_5\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#mcb4a81abfa\" x=\"258.41009\" y=\"244.078125\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_5\">\n",
       "      <!-- 20 -->\n",
       "      <g transform=\"translate(252.04759 258.676562) scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path id=\"DejaVuSans-32\" d=\"M 1228 531 \n",
       "L 3431 531 \n",
       "L 3431 0 \n",
       "L 469 0 \n",
       "L 469 531 \n",
       "Q 828 903 1448 1529 \n",
       "Q 2069 2156 2228 2338 \n",
       "Q 2531 2678 2651 2914 \n",
       "Q 2772 3150 2772 3378 \n",
       "Q 2772 3750 2511 3984 \n",
       "Q 2250 4219 1831 4219 \n",
       "Q 1534 4219 1204 4116 \n",
       "Q 875 4013 500 3803 \n",
       "L 500 4441 \n",
       "Q 881 4594 1212 4672 \n",
       "Q 1544 4750 1819 4750 \n",
       "Q 2544 4750 2975 4387 \n",
       "Q 3406 4025 3406 3419 \n",
       "Q 3406 3131 3298 2873 \n",
       "Q 3191 2616 2906 2266 \n",
       "Q 2828 2175 2409 1742 \n",
       "Q 1991 1309 1228 531 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-32\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"63.623047\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_6\">\n",
       "     <g id=\"line2d_6\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#mcb4a81abfa\" x=\"310.886579\" y=\"244.078125\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_6\">\n",
       "      <!-- 25 -->\n",
       "      <g transform=\"translate(304.524079 258.676562) scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-32\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-35\" x=\"63.623047\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"xtick_7\">\n",
       "     <g id=\"line2d_7\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#mcb4a81abfa\" x=\"363.363068\" y=\"244.078125\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_7\">\n",
       "      <!-- 30 -->\n",
       "      <g transform=\"translate(357.000568 258.676562) scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path id=\"DejaVuSans-33\" d=\"M 2597 2516 \n",
       "Q 3050 2419 3304 2112 \n",
       "Q 3559 1806 3559 1356 \n",
       "Q 3559 666 3084 287 \n",
       "Q 2609 -91 1734 -91 \n",
       "Q 1441 -91 1130 -33 \n",
       "Q 819 25 488 141 \n",
       "L 488 750 \n",
       "Q 750 597 1062 519 \n",
       "Q 1375 441 1716 441 \n",
       "Q 2309 441 2620 675 \n",
       "Q 2931 909 2931 1356 \n",
       "Q 2931 1769 2642 2001 \n",
       "Q 2353 2234 1838 2234 \n",
       "L 1294 2234 \n",
       "L 1294 2753 \n",
       "L 1863 2753 \n",
       "Q 2328 2753 2575 2939 \n",
       "Q 2822 3125 2822 3475 \n",
       "Q 2822 3834 2567 4026 \n",
       "Q 2313 4219 1838 4219 \n",
       "Q 1578 4219 1281 4162 \n",
       "Q 984 4106 628 3988 \n",
       "L 628 4550 \n",
       "Q 988 4650 1302 4700 \n",
       "Q 1616 4750 1894 4750 \n",
       "Q 2613 4750 3031 4423 \n",
       "Q 3450 4097 3450 3541 \n",
       "Q 3450 3153 3228 2886 \n",
       "Q 3006 2619 2597 2516 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-33\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"63.623047\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"text_8\">\n",
       "     <!-- epoch -->\n",
       "     <g transform=\"translate(195.953125 272.354687) scale(0.1 -0.1)\">\n",
       "      <defs>\n",
       "       <path id=\"DejaVuSans-65\" d=\"M 3597 1894 \n",
       "L 3597 1613 \n",
       "L 953 1613 \n",
       "Q 991 1019 1311 708 \n",
       "Q 1631 397 2203 397 \n",
       "Q 2534 397 2845 478 \n",
       "Q 3156 559 3463 722 \n",
       "L 3463 178 \n",
       "Q 3153 47 2828 -22 \n",
       "Q 2503 -91 2169 -91 \n",
       "Q 1331 -91 842 396 \n",
       "Q 353 884 353 1716 \n",
       "Q 353 2575 817 3079 \n",
       "Q 1281 3584 2069 3584 \n",
       "Q 2775 3584 3186 3129 \n",
       "Q 3597 2675 3597 1894 \n",
       "z\n",
       "M 3022 2063 \n",
       "Q 3016 2534 2758 2815 \n",
       "Q 2500 3097 2075 3097 \n",
       "Q 1594 3097 1305 2825 \n",
       "Q 1016 2553 972 2059 \n",
       "L 3022 2063 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       <path id=\"DejaVuSans-70\" d=\"M 1159 525 \n",
       "L 1159 -1331 \n",
       "L 581 -1331 \n",
       "L 581 3500 \n",
       "L 1159 3500 \n",
       "L 1159 2969 \n",
       "Q 1341 3281 1617 3432 \n",
       "Q 1894 3584 2278 3584 \n",
       "Q 2916 3584 3314 3078 \n",
       "Q 3713 2572 3713 1747 \n",
       "Q 3713 922 3314 415 \n",
       "Q 2916 -91 2278 -91 \n",
       "Q 1894 -91 1617 61 \n",
       "Q 1341 213 1159 525 \n",
       "z\n",
       "M 3116 1747 \n",
       "Q 3116 2381 2855 2742 \n",
       "Q 2594 3103 2138 3103 \n",
       "Q 1681 3103 1420 2742 \n",
       "Q 1159 2381 1159 1747 \n",
       "Q 1159 1113 1420 752 \n",
       "Q 1681 391 2138 391 \n",
       "Q 2594 391 2855 752 \n",
       "Q 3116 1113 3116 1747 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       <path id=\"DejaVuSans-6f\" d=\"M 1959 3097 \n",
       "Q 1497 3097 1228 2736 \n",
       "Q 959 2375 959 1747 \n",
       "Q 959 1119 1226 758 \n",
       "Q 1494 397 1959 397 \n",
       "Q 2419 397 2687 759 \n",
       "Q 2956 1122 2956 1747 \n",
       "Q 2956 2369 2687 2733 \n",
       "Q 2419 3097 1959 3097 \n",
       "z\n",
       "M 1959 3584 \n",
       "Q 2709 3584 3137 3096 \n",
       "Q 3566 2609 3566 1747 \n",
       "Q 3566 888 3137 398 \n",
       "Q 2709 -91 1959 -91 \n",
       "Q 1206 -91 779 398 \n",
       "Q 353 888 353 1747 \n",
       "Q 353 2609 779 3096 \n",
       "Q 1206 3584 1959 3584 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       <path id=\"DejaVuSans-63\" d=\"M 3122 3366 \n",
       "L 3122 2828 \n",
       "Q 2878 2963 2633 3030 \n",
       "Q 2388 3097 2138 3097 \n",
       "Q 1578 3097 1268 2742 \n",
       "Q 959 2388 959 1747 \n",
       "Q 959 1106 1268 751 \n",
       "Q 1578 397 2138 397 \n",
       "Q 2388 397 2633 464 \n",
       "Q 2878 531 3122 666 \n",
       "L 3122 134 \n",
       "Q 2881 22 2623 -34 \n",
       "Q 2366 -91 2075 -91 \n",
       "Q 1284 -91 818 406 \n",
       "Q 353 903 353 1747 \n",
       "Q 353 2603 823 3093 \n",
       "Q 1294 3584 2113 3584 \n",
       "Q 2378 3584 2631 3529 \n",
       "Q 2884 3475 3122 3366 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       <path id=\"DejaVuSans-68\" d=\"M 3513 2113 \n",
       "L 3513 0 \n",
       "L 2938 0 \n",
       "L 2938 2094 \n",
       "Q 2938 2591 2744 2837 \n",
       "Q 2550 3084 2163 3084 \n",
       "Q 1697 3084 1428 2787 \n",
       "Q 1159 2491 1159 1978 \n",
       "L 1159 0 \n",
       "L 581 0 \n",
       "L 581 4863 \n",
       "L 1159 4863 \n",
       "L 1159 2956 \n",
       "Q 1366 3272 1645 3428 \n",
       "Q 1925 3584 2291 3584 \n",
       "Q 2894 3584 3203 3211 \n",
       "Q 3513 2838 3513 2113 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "      </defs>\n",
       "      <use xlink:href=\"#DejaVuSans-65\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-70\" x=\"61.523438\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-6f\" x=\"125\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-63\" x=\"186.181641\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-68\" x=\"241.162109\"/>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"matplotlib.axis_2\">\n",
       "    <g id=\"ytick_1\">\n",
       "     <g id=\"line2d_8\">\n",
       "      <defs>\n",
       "       <path id=\"m5017a5e46a\" d=\"M 0 0 \n",
       "L -3.5 0 \n",
       "\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </defs>\n",
       "      <g>\n",
       "       <use xlink:href=\"#m5017a5e46a\" x=\"43.78125\" y=\"228.408569\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_9\">\n",
       "      <!-- 0.6 -->\n",
       "      <g transform=\"translate(20.878125 232.207787) scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path id=\"DejaVuSans-2e\" d=\"M 684 794 \n",
       "L 1344 794 \n",
       "L 1344 0 \n",
       "L 684 0 \n",
       "L 684 794 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "        <path id=\"DejaVuSans-36\" d=\"M 2113 2584 \n",
       "Q 1688 2584 1439 2293 \n",
       "Q 1191 2003 1191 1497 \n",
       "Q 1191 994 1439 701 \n",
       "Q 1688 409 2113 409 \n",
       "Q 2538 409 2786 701 \n",
       "Q 3034 994 3034 1497 \n",
       "Q 3034 2003 2786 2293 \n",
       "Q 2538 2584 2113 2584 \n",
       "z\n",
       "M 3366 4563 \n",
       "L 3366 3988 \n",
       "Q 3128 4100 2886 4159 \n",
       "Q 2644 4219 2406 4219 \n",
       "Q 1781 4219 1451 3797 \n",
       "Q 1122 3375 1075 2522 \n",
       "Q 1259 2794 1537 2939 \n",
       "Q 1816 3084 2150 3084 \n",
       "Q 2853 3084 3261 2657 \n",
       "Q 3669 2231 3669 1497 \n",
       "Q 3669 778 3244 343 \n",
       "Q 2819 -91 2113 -91 \n",
       "Q 1303 -91 875 529 \n",
       "Q 447 1150 447 2328 \n",
       "Q 447 3434 972 4092 \n",
       "Q 1497 4750 2381 4750 \n",
       "Q 2619 4750 2861 4703 \n",
       "Q 3103 4656 3366 4563 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-30\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-2e\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-36\" x=\"95.410156\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_2\">\n",
       "     <g id=\"line2d_9\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#m5017a5e46a\" x=\"43.78125\" y=\"187.232855\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_10\">\n",
       "      <!-- 0.8 -->\n",
       "      <g transform=\"translate(20.878125 191.032074) scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path id=\"DejaVuSans-38\" d=\"M 2034 2216 \n",
       "Q 1584 2216 1326 1975 \n",
       "Q 1069 1734 1069 1313 \n",
       "Q 1069 891 1326 650 \n",
       "Q 1584 409 2034 409 \n",
       "Q 2484 409 2743 651 \n",
       "Q 3003 894 3003 1313 \n",
       "Q 3003 1734 2745 1975 \n",
       "Q 2488 2216 2034 2216 \n",
       "z\n",
       "M 1403 2484 \n",
       "Q 997 2584 770 2862 \n",
       "Q 544 3141 544 3541 \n",
       "Q 544 4100 942 4425 \n",
       "Q 1341 4750 2034 4750 \n",
       "Q 2731 4750 3128 4425 \n",
       "Q 3525 4100 3525 3541 \n",
       "Q 3525 3141 3298 2862 \n",
       "Q 3072 2584 2669 2484 \n",
       "Q 3125 2378 3379 2068 \n",
       "Q 3634 1759 3634 1313 \n",
       "Q 3634 634 3220 271 \n",
       "Q 2806 -91 2034 -91 \n",
       "Q 1263 -91 848 271 \n",
       "Q 434 634 434 1313 \n",
       "Q 434 1759 690 2068 \n",
       "Q 947 2378 1403 2484 \n",
       "z\n",
       "M 1172 3481 \n",
       "Q 1172 3119 1398 2916 \n",
       "Q 1625 2713 2034 2713 \n",
       "Q 2441 2713 2670 2916 \n",
       "Q 2900 3119 2900 3481 \n",
       "Q 2900 3844 2670 4047 \n",
       "Q 2441 4250 2034 4250 \n",
       "Q 1625 4250 1398 4047 \n",
       "Q 1172 3844 1172 3481 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-30\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-2e\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-38\" x=\"95.410156\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_3\">\n",
       "     <g id=\"line2d_10\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#m5017a5e46a\" x=\"43.78125\" y=\"146.057142\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_11\">\n",
       "      <!-- 1.0 -->\n",
       "      <g transform=\"translate(20.878125 149.856361) scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-31\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-2e\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-30\" x=\"95.410156\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_4\">\n",
       "     <g id=\"line2d_11\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#m5017a5e46a\" x=\"43.78125\" y=\"104.881428\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_12\">\n",
       "      <!-- 1.2 -->\n",
       "      <g transform=\"translate(20.878125 108.680647) scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-31\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-2e\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-32\" x=\"95.410156\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_5\">\n",
       "     <g id=\"line2d_12\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#m5017a5e46a\" x=\"43.78125\" y=\"63.705715\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_13\">\n",
       "      <!-- 1.4 -->\n",
       "      <g transform=\"translate(20.878125 67.504934) scale(0.1 -0.1)\">\n",
       "       <defs>\n",
       "        <path id=\"DejaVuSans-34\" d=\"M 2419 4116 \n",
       "L 825 1625 \n",
       "L 2419 1625 \n",
       "L 2419 4116 \n",
       "z\n",
       "M 2253 4666 \n",
       "L 3047 4666 \n",
       "L 3047 1625 \n",
       "L 3713 1625 \n",
       "L 3713 1100 \n",
       "L 3047 1100 \n",
       "L 3047 0 \n",
       "L 2419 0 \n",
       "L 2419 1100 \n",
       "L 313 1100 \n",
       "L 313 1709 \n",
       "L 2253 4666 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       </defs>\n",
       "       <use xlink:href=\"#DejaVuSans-31\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-2e\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-34\" x=\"95.410156\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"ytick_6\">\n",
       "     <g id=\"line2d_13\">\n",
       "      <g>\n",
       "       <use xlink:href=\"#m5017a5e46a\" x=\"43.78125\" y=\"22.530002\" style=\"stroke: #000000; stroke-width: 0.8\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "     <g id=\"text_14\">\n",
       "      <!-- 1.6 -->\n",
       "      <g transform=\"translate(20.878125 26.32922) scale(0.1 -0.1)\">\n",
       "       <use xlink:href=\"#DejaVuSans-31\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-2e\" x=\"63.623047\"/>\n",
       "       <use xlink:href=\"#DejaVuSans-36\" x=\"95.410156\"/>\n",
       "      </g>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"text_15\">\n",
       "     <!-- loss -->\n",
       "     <g transform=\"translate(14.798438 142.855937) rotate(-90) scale(0.1 -0.1)\">\n",
       "      <defs>\n",
       "       <path id=\"DejaVuSans-6c\" d=\"M 603 4863 \n",
       "L 1178 4863 \n",
       "L 1178 0 \n",
       "L 603 0 \n",
       "L 603 4863 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       <path id=\"DejaVuSans-73\" d=\"M 2834 3397 \n",
       "L 2834 2853 \n",
       "Q 2591 2978 2328 3040 \n",
       "Q 2066 3103 1784 3103 \n",
       "Q 1356 3103 1142 2972 \n",
       "Q 928 2841 928 2578 \n",
       "Q 928 2378 1081 2264 \n",
       "Q 1234 2150 1697 2047 \n",
       "L 1894 2003 \n",
       "Q 2506 1872 2764 1633 \n",
       "Q 3022 1394 3022 966 \n",
       "Q 3022 478 2636 193 \n",
       "Q 2250 -91 1575 -91 \n",
       "Q 1294 -91 989 -36 \n",
       "Q 684 19 347 128 \n",
       "L 347 722 \n",
       "Q 666 556 975 473 \n",
       "Q 1284 391 1588 391 \n",
       "Q 1994 391 2212 530 \n",
       "Q 2431 669 2431 922 \n",
       "Q 2431 1156 2273 1281 \n",
       "Q 2116 1406 1581 1522 \n",
       "L 1381 1569 \n",
       "Q 847 1681 609 1914 \n",
       "Q 372 2147 372 2553 \n",
       "Q 372 3047 722 3315 \n",
       "Q 1072 3584 1716 3584 \n",
       "Q 2034 3584 2315 3537 \n",
       "Q 2597 3491 2834 3397 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "      </defs>\n",
       "      <use xlink:href=\"#DejaVuSans-6c\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-6f\" x=\"27.783203\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-73\" x=\"88.964844\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-73\" x=\"141.064453\"/>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"line2d_14\">\n",
       "    <path d=\"M 58.999432 32.398125 \n",
       "L 69.49473 60.688104 \n",
       "L 79.990027 87.262554 \n",
       "L 90.485325 112.138284 \n",
       "L 100.980623 135.267388 \n",
       "L 111.475921 156.569036 \n",
       "L 121.971219 176.014781 \n",
       "L 132.466516 193.542765 \n",
       "L 142.961814 209.094514 \n",
       "L 153.457112 222.596303 \n",
       "L 163.95241 233.987793 \n",
       "L 174.447708 233.988811 \n",
       "L 184.943005 233.989866 \n",
       "L 195.438303 233.990897 \n",
       "L 205.933601 233.991916 \n",
       "L 216.428899 233.992959 \n",
       "L 226.924197 233.993977 \n",
       "L 237.419495 233.99502 \n",
       "L 247.914792 233.996051 \n",
       "L 258.41009 233.997094 \n",
       "L 268.905388 233.998125 \n",
       "L 279.400686 233.998125 \n",
       "L 289.895984 233.998125 \n",
       "L 300.391281 233.998125 \n",
       "L 310.886579 233.998125 \n",
       "L 321.381877 233.998125 \n",
       "L 331.877175 233.998125 \n",
       "L 342.372473 233.998125 \n",
       "L 352.86777 233.998125 \n",
       "L 363.363068 233.998125 \n",
       "\" style=\"fill: none; stroke-dasharray: 5.55,2.4; stroke-dashoffset: 0; stroke: #0000ff; stroke-width: 1.5\"/>\n",
       "    <defs>\n",
       "     <path id=\"m9acc1b7416\" d=\"M 0 3 \n",
       "C 0.795609 3 1.55874 2.683901 2.12132 2.12132 \n",
       "C 2.683901 1.55874 3 0.795609 3 0 \n",
       "C 3 -0.795609 2.683901 -1.55874 2.12132 -2.12132 \n",
       "C 1.55874 -2.683901 0.795609 -3 0 -3 \n",
       "C -0.795609 -3 -1.55874 -2.683901 -2.12132 -2.12132 \n",
       "C -2.683901 -1.55874 -3 -0.795609 -3 0 \n",
       "C -3 0.795609 -2.683901 1.55874 -2.12132 2.12132 \n",
       "C -1.55874 2.683901 -0.795609 3 0 3 \n",
       "z\n",
       "\" style=\"stroke: #0000ff\"/>\n",
       "    </defs>\n",
       "    <g>\n",
       "     <use xlink:href=\"#m9acc1b7416\" x=\"58.999432\" y=\"32.398125\" style=\"fill: #0000ff; stroke: #0000ff\"/>\n",
       "     <use xlink:href=\"#m9acc1b7416\" x=\"69.49473\" y=\"60.688104\" style=\"fill: #0000ff; stroke: #0000ff\"/>\n",
       "     <use xlink:href=\"#m9acc1b7416\" x=\"79.990027\" y=\"87.262554\" style=\"fill: #0000ff; stroke: #0000ff\"/>\n",
       "     <use xlink:href=\"#m9acc1b7416\" x=\"90.485325\" y=\"112.138284\" style=\"fill: #0000ff; stroke: #0000ff\"/>\n",
       "     <use xlink:href=\"#m9acc1b7416\" x=\"100.980623\" y=\"135.267388\" style=\"fill: #0000ff; stroke: #0000ff\"/>\n",
       "     <use xlink:href=\"#m9acc1b7416\" x=\"111.475921\" y=\"156.569036\" style=\"fill: #0000ff; stroke: #0000ff\"/>\n",
       "     <use xlink:href=\"#m9acc1b7416\" x=\"121.971219\" y=\"176.014781\" style=\"fill: #0000ff; stroke: #0000ff\"/>\n",
       "     <use xlink:href=\"#m9acc1b7416\" x=\"132.466516\" y=\"193.542765\" style=\"fill: #0000ff; stroke: #0000ff\"/>\n",
       "     <use xlink:href=\"#m9acc1b7416\" x=\"142.961814\" y=\"209.094514\" style=\"fill: #0000ff; stroke: #0000ff\"/>\n",
       "     <use xlink:href=\"#m9acc1b7416\" x=\"153.457112\" y=\"222.596303\" style=\"fill: #0000ff; stroke: #0000ff\"/>\n",
       "     <use xlink:href=\"#m9acc1b7416\" x=\"163.95241\" y=\"233.987793\" style=\"fill: #0000ff; stroke: #0000ff\"/>\n",
       "     <use xlink:href=\"#m9acc1b7416\" x=\"174.447708\" y=\"233.988811\" style=\"fill: #0000ff; stroke: #0000ff\"/>\n",
       "     <use xlink:href=\"#m9acc1b7416\" x=\"184.943005\" y=\"233.989866\" style=\"fill: #0000ff; stroke: #0000ff\"/>\n",
       "     <use xlink:href=\"#m9acc1b7416\" x=\"195.438303\" y=\"233.990897\" style=\"fill: #0000ff; stroke: #0000ff\"/>\n",
       "     <use xlink:href=\"#m9acc1b7416\" x=\"205.933601\" y=\"233.991916\" style=\"fill: #0000ff; stroke: #0000ff\"/>\n",
       "     <use xlink:href=\"#m9acc1b7416\" x=\"216.428899\" y=\"233.992959\" style=\"fill: #0000ff; stroke: #0000ff\"/>\n",
       "     <use xlink:href=\"#m9acc1b7416\" x=\"226.924197\" y=\"233.993977\" style=\"fill: #0000ff; stroke: #0000ff\"/>\n",
       "     <use xlink:href=\"#m9acc1b7416\" x=\"237.419495\" y=\"233.99502\" style=\"fill: #0000ff; stroke: #0000ff\"/>\n",
       "     <use xlink:href=\"#m9acc1b7416\" x=\"247.914792\" y=\"233.996051\" style=\"fill: #0000ff; stroke: #0000ff\"/>\n",
       "     <use xlink:href=\"#m9acc1b7416\" x=\"258.41009\" y=\"233.997094\" style=\"fill: #0000ff; stroke: #0000ff\"/>\n",
       "     <use xlink:href=\"#m9acc1b7416\" x=\"268.905388\" y=\"233.998125\" style=\"fill: #0000ff; stroke: #0000ff\"/>\n",
       "     <use xlink:href=\"#m9acc1b7416\" x=\"279.400686\" y=\"233.998125\" style=\"fill: #0000ff; stroke: #0000ff\"/>\n",
       "     <use xlink:href=\"#m9acc1b7416\" x=\"289.895984\" y=\"233.998125\" style=\"fill: #0000ff; stroke: #0000ff\"/>\n",
       "     <use xlink:href=\"#m9acc1b7416\" x=\"300.391281\" y=\"233.998125\" style=\"fill: #0000ff; stroke: #0000ff\"/>\n",
       "     <use xlink:href=\"#m9acc1b7416\" x=\"310.886579\" y=\"233.998125\" style=\"fill: #0000ff; stroke: #0000ff\"/>\n",
       "     <use xlink:href=\"#m9acc1b7416\" x=\"321.381877\" y=\"233.998125\" style=\"fill: #0000ff; stroke: #0000ff\"/>\n",
       "     <use xlink:href=\"#m9acc1b7416\" x=\"331.877175\" y=\"233.998125\" style=\"fill: #0000ff; stroke: #0000ff\"/>\n",
       "     <use xlink:href=\"#m9acc1b7416\" x=\"342.372473\" y=\"233.998125\" style=\"fill: #0000ff; stroke: #0000ff\"/>\n",
       "     <use xlink:href=\"#m9acc1b7416\" x=\"352.86777\" y=\"233.998125\" style=\"fill: #0000ff; stroke: #0000ff\"/>\n",
       "     <use xlink:href=\"#m9acc1b7416\" x=\"363.363068\" y=\"233.998125\" style=\"fill: #0000ff; stroke: #0000ff\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"line2d_15\">\n",
       "    <path d=\"M 58.999432 60.688104 \n",
       "L 69.49473 87.262554 \n",
       "L 79.990027 112.138284 \n",
       "L 90.485325 135.267388 \n",
       "L 100.980623 156.569036 \n",
       "L 111.475921 176.014781 \n",
       "L 121.971219 193.542765 \n",
       "L 132.466516 209.094514 \n",
       "L 142.961814 222.596303 \n",
       "L 153.457112 233.987793 \n",
       "L 163.95241 233.988811 \n",
       "L 174.447708 233.989866 \n",
       "L 184.943005 233.990897 \n",
       "L 195.438303 233.991916 \n",
       "L 205.933601 233.992959 \n",
       "L 216.428899 233.993977 \n",
       "L 226.924197 233.99502 \n",
       "L 237.419495 233.996051 \n",
       "L 247.914792 233.997094 \n",
       "L 258.41009 233.998125 \n",
       "L 268.905388 233.998125 \n",
       "L 279.400686 233.998125 \n",
       "L 289.895984 233.998125 \n",
       "L 300.391281 233.998125 \n",
       "L 310.886579 233.998125 \n",
       "L 321.381877 233.998125 \n",
       "L 331.877175 233.998125 \n",
       "L 342.372473 233.998125 \n",
       "L 352.86777 233.998125 \n",
       "L 363.363068 233.998125 \n",
       "\" style=\"fill: none; stroke: #00bfbf; stroke-width: 1.5; stroke-linecap: square\"/>\n",
       "    <defs>\n",
       "     <path id=\"m08f92ecf87\" d=\"M 0 3 \n",
       "C 0.795609 3 1.55874 2.683901 2.12132 2.12132 \n",
       "C 2.683901 1.55874 3 0.795609 3 0 \n",
       "C 3 -0.795609 2.683901 -1.55874 2.12132 -2.12132 \n",
       "C 1.55874 -2.683901 0.795609 -3 0 -3 \n",
       "C -0.795609 -3 -1.55874 -2.683901 -2.12132 -2.12132 \n",
       "C -2.683901 -1.55874 -3 -0.795609 -3 0 \n",
       "C -3 0.795609 -2.683901 1.55874 -2.12132 2.12132 \n",
       "C -1.55874 2.683901 -0.795609 3 0 3 \n",
       "z\n",
       "\" style=\"stroke: #00bfbf\"/>\n",
       "    </defs>\n",
       "    <g>\n",
       "     <use xlink:href=\"#m08f92ecf87\" x=\"58.999432\" y=\"60.688104\" style=\"fill: #00bfbf; stroke: #00bfbf\"/>\n",
       "     <use xlink:href=\"#m08f92ecf87\" x=\"69.49473\" y=\"87.262554\" style=\"fill: #00bfbf; stroke: #00bfbf\"/>\n",
       "     <use xlink:href=\"#m08f92ecf87\" x=\"79.990027\" y=\"112.138284\" style=\"fill: #00bfbf; stroke: #00bfbf\"/>\n",
       "     <use xlink:href=\"#m08f92ecf87\" x=\"90.485325\" y=\"135.267388\" style=\"fill: #00bfbf; stroke: #00bfbf\"/>\n",
       "     <use xlink:href=\"#m08f92ecf87\" x=\"100.980623\" y=\"156.569036\" style=\"fill: #00bfbf; stroke: #00bfbf\"/>\n",
       "     <use xlink:href=\"#m08f92ecf87\" x=\"111.475921\" y=\"176.014781\" style=\"fill: #00bfbf; stroke: #00bfbf\"/>\n",
       "     <use xlink:href=\"#m08f92ecf87\" x=\"121.971219\" y=\"193.542765\" style=\"fill: #00bfbf; stroke: #00bfbf\"/>\n",
       "     <use xlink:href=\"#m08f92ecf87\" x=\"132.466516\" y=\"209.094514\" style=\"fill: #00bfbf; stroke: #00bfbf\"/>\n",
       "     <use xlink:href=\"#m08f92ecf87\" x=\"142.961814\" y=\"222.596303\" style=\"fill: #00bfbf; stroke: #00bfbf\"/>\n",
       "     <use xlink:href=\"#m08f92ecf87\" x=\"153.457112\" y=\"233.987793\" style=\"fill: #00bfbf; stroke: #00bfbf\"/>\n",
       "     <use xlink:href=\"#m08f92ecf87\" x=\"163.95241\" y=\"233.988811\" style=\"fill: #00bfbf; stroke: #00bfbf\"/>\n",
       "     <use xlink:href=\"#m08f92ecf87\" x=\"174.447708\" y=\"233.989866\" style=\"fill: #00bfbf; stroke: #00bfbf\"/>\n",
       "     <use xlink:href=\"#m08f92ecf87\" x=\"184.943005\" y=\"233.990897\" style=\"fill: #00bfbf; stroke: #00bfbf\"/>\n",
       "     <use xlink:href=\"#m08f92ecf87\" x=\"195.438303\" y=\"233.991916\" style=\"fill: #00bfbf; stroke: #00bfbf\"/>\n",
       "     <use xlink:href=\"#m08f92ecf87\" x=\"205.933601\" y=\"233.992959\" style=\"fill: #00bfbf; stroke: #00bfbf\"/>\n",
       "     <use xlink:href=\"#m08f92ecf87\" x=\"216.428899\" y=\"233.993977\" style=\"fill: #00bfbf; stroke: #00bfbf\"/>\n",
       "     <use xlink:href=\"#m08f92ecf87\" x=\"226.924197\" y=\"233.99502\" style=\"fill: #00bfbf; stroke: #00bfbf\"/>\n",
       "     <use xlink:href=\"#m08f92ecf87\" x=\"237.419495\" y=\"233.996051\" style=\"fill: #00bfbf; stroke: #00bfbf\"/>\n",
       "     <use xlink:href=\"#m08f92ecf87\" x=\"247.914792\" y=\"233.997094\" style=\"fill: #00bfbf; stroke: #00bfbf\"/>\n",
       "     <use xlink:href=\"#m08f92ecf87\" x=\"258.41009\" y=\"233.998125\" style=\"fill: #00bfbf; stroke: #00bfbf\"/>\n",
       "     <use xlink:href=\"#m08f92ecf87\" x=\"268.905388\" y=\"233.998125\" style=\"fill: #00bfbf; stroke: #00bfbf\"/>\n",
       "     <use xlink:href=\"#m08f92ecf87\" x=\"279.400686\" y=\"233.998125\" style=\"fill: #00bfbf; stroke: #00bfbf\"/>\n",
       "     <use xlink:href=\"#m08f92ecf87\" x=\"289.895984\" y=\"233.998125\" style=\"fill: #00bfbf; stroke: #00bfbf\"/>\n",
       "     <use xlink:href=\"#m08f92ecf87\" x=\"300.391281\" y=\"233.998125\" style=\"fill: #00bfbf; stroke: #00bfbf\"/>\n",
       "     <use xlink:href=\"#m08f92ecf87\" x=\"310.886579\" y=\"233.998125\" style=\"fill: #00bfbf; stroke: #00bfbf\"/>\n",
       "     <use xlink:href=\"#m08f92ecf87\" x=\"321.381877\" y=\"233.998125\" style=\"fill: #00bfbf; stroke: #00bfbf\"/>\n",
       "     <use xlink:href=\"#m08f92ecf87\" x=\"331.877175\" y=\"233.998125\" style=\"fill: #00bfbf; stroke: #00bfbf\"/>\n",
       "     <use xlink:href=\"#m08f92ecf87\" x=\"342.372473\" y=\"233.998125\" style=\"fill: #00bfbf; stroke: #00bfbf\"/>\n",
       "     <use xlink:href=\"#m08f92ecf87\" x=\"352.86777\" y=\"233.998125\" style=\"fill: #00bfbf; stroke: #00bfbf\"/>\n",
       "     <use xlink:href=\"#m08f92ecf87\" x=\"363.363068\" y=\"233.998125\" style=\"fill: #00bfbf; stroke: #00bfbf\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"line2d_16\">\n",
       "    <defs>\n",
       "     <path id=\"me5e6523a75\" d=\"M 0 -7.5 \n",
       "L -1.683855 -2.317627 \n",
       "L -7.132924 -2.317627 \n",
       "L -2.724534 0.885255 \n",
       "L -4.408389 6.067627 \n",
       "L -0 2.864745 \n",
       "L 4.408389 6.067627 \n",
       "L 2.724534 0.885255 \n",
       "L 7.132924 -2.317627 \n",
       "L 1.683855 -2.317627 \n",
       "z\n",
       "\" style=\"stroke: #ff0000; stroke-linejoin: bevel\"/>\n",
       "    </defs>\n",
       "    <g>\n",
       "     <use xlink:href=\"#me5e6523a75\" x=\"258.41009\" y=\"233.998125\" style=\"fill: #ff0000; stroke: #ff0000; stroke-linejoin: bevel\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"patch_3\">\n",
       "    <path d=\"M 43.78125 244.078125 \n",
       "L 43.78125 22.318125 \n",
       "\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_4\">\n",
       "    <path d=\"M 378.58125 244.078125 \n",
       "L 378.58125 22.318125 \n",
       "\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_5\">\n",
       "    <path d=\"M 43.78125 244.078125 \n",
       "L 378.58125 244.078125 \n",
       "\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n",
       "   </g>\n",
       "   <g id=\"patch_6\">\n",
       "    <path d=\"M 43.78125 22.318125 \n",
       "L 378.58125 22.318125 \n",
       "\" style=\"fill: none; stroke: #000000; stroke-width: 0.8; stroke-linejoin: miter; stroke-linecap: square\"/>\n",
       "   </g>\n",
       "   <g id=\"text_16\">\n",
       "    <!-- best val_loss=0.5729 (@epoch 20) -->\n",
       "    <g transform=\"translate(106.384688 16.318125) scale(0.12 -0.12)\">\n",
       "     <defs>\n",
       "      <path id=\"DejaVuSans-62\" d=\"M 3116 1747 \n",
       "Q 3116 2381 2855 2742 \n",
       "Q 2594 3103 2138 3103 \n",
       "Q 1681 3103 1420 2742 \n",
       "Q 1159 2381 1159 1747 \n",
       "Q 1159 1113 1420 752 \n",
       "Q 1681 391 2138 391 \n",
       "Q 2594 391 2855 752 \n",
       "Q 3116 1113 3116 1747 \n",
       "z\n",
       "M 1159 2969 \n",
       "Q 1341 3281 1617 3432 \n",
       "Q 1894 3584 2278 3584 \n",
       "Q 2916 3584 3314 3078 \n",
       "Q 3713 2572 3713 1747 \n",
       "Q 3713 922 3314 415 \n",
       "Q 2916 -91 2278 -91 \n",
       "Q 1894 -91 1617 61 \n",
       "Q 1341 213 1159 525 \n",
       "L 1159 0 \n",
       "L 581 0 \n",
       "L 581 4863 \n",
       "L 1159 4863 \n",
       "L 1159 2969 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "      <path id=\"DejaVuSans-74\" d=\"M 1172 4494 \n",
       "L 1172 3500 \n",
       "L 2356 3500 \n",
       "L 2356 3053 \n",
       "L 1172 3053 \n",
       "L 1172 1153 \n",
       "Q 1172 725 1289 603 \n",
       "Q 1406 481 1766 481 \n",
       "L 2356 481 \n",
       "L 2356 0 \n",
       "L 1766 0 \n",
       "Q 1100 0 847 248 \n",
       "Q 594 497 594 1153 \n",
       "L 594 3053 \n",
       "L 172 3053 \n",
       "L 172 3500 \n",
       "L 594 3500 \n",
       "L 594 4494 \n",
       "L 1172 4494 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "      <path id=\"DejaVuSans-20\" transform=\"scale(0.015625)\"/>\n",
       "      <path id=\"DejaVuSans-76\" d=\"M 191 3500 \n",
       "L 800 3500 \n",
       "L 1894 563 \n",
       "L 2988 3500 \n",
       "L 3597 3500 \n",
       "L 2284 0 \n",
       "L 1503 0 \n",
       "L 191 3500 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "      <path id=\"DejaVuSans-61\" d=\"M 2194 1759 \n",
       "Q 1497 1759 1228 1600 \n",
       "Q 959 1441 959 1056 \n",
       "Q 959 750 1161 570 \n",
       "Q 1363 391 1709 391 \n",
       "Q 2188 391 2477 730 \n",
       "Q 2766 1069 2766 1631 \n",
       "L 2766 1759 \n",
       "L 2194 1759 \n",
       "z\n",
       "M 3341 1997 \n",
       "L 3341 0 \n",
       "L 2766 0 \n",
       "L 2766 531 \n",
       "Q 2569 213 2275 61 \n",
       "Q 1981 -91 1556 -91 \n",
       "Q 1019 -91 701 211 \n",
       "Q 384 513 384 1019 \n",
       "Q 384 1609 779 1909 \n",
       "Q 1175 2209 1959 2209 \n",
       "L 2766 2209 \n",
       "L 2766 2266 \n",
       "Q 2766 2663 2505 2880 \n",
       "Q 2244 3097 1772 3097 \n",
       "Q 1472 3097 1187 3025 \n",
       "Q 903 2953 641 2809 \n",
       "L 641 3341 \n",
       "Q 956 3463 1253 3523 \n",
       "Q 1550 3584 1831 3584 \n",
       "Q 2591 3584 2966 3190 \n",
       "Q 3341 2797 3341 1997 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "      <path id=\"DejaVuSans-5f\" d=\"M 3263 -1063 \n",
       "L 3263 -1509 \n",
       "L -63 -1509 \n",
       "L -63 -1063 \n",
       "L 3263 -1063 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "      <path id=\"DejaVuSans-3d\" d=\"M 678 2906 \n",
       "L 4684 2906 \n",
       "L 4684 2381 \n",
       "L 678 2381 \n",
       "L 678 2906 \n",
       "z\n",
       "M 678 1631 \n",
       "L 4684 1631 \n",
       "L 4684 1100 \n",
       "L 678 1100 \n",
       "L 678 1631 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "      <path id=\"DejaVuSans-37\" d=\"M 525 4666 \n",
       "L 3525 4666 \n",
       "L 3525 4397 \n",
       "L 1831 0 \n",
       "L 1172 0 \n",
       "L 2766 4134 \n",
       "L 525 4134 \n",
       "L 525 4666 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "      <path id=\"DejaVuSans-39\" d=\"M 703 97 \n",
       "L 703 672 \n",
       "Q 941 559 1184 500 \n",
       "Q 1428 441 1663 441 \n",
       "Q 2288 441 2617 861 \n",
       "Q 2947 1281 2994 2138 \n",
       "Q 2813 1869 2534 1725 \n",
       "Q 2256 1581 1919 1581 \n",
       "Q 1219 1581 811 2004 \n",
       "Q 403 2428 403 3163 \n",
       "Q 403 3881 828 4315 \n",
       "Q 1253 4750 1959 4750 \n",
       "Q 2769 4750 3195 4129 \n",
       "Q 3622 3509 3622 2328 \n",
       "Q 3622 1225 3098 567 \n",
       "Q 2575 -91 1691 -91 \n",
       "Q 1453 -91 1209 -44 \n",
       "Q 966 3 703 97 \n",
       "z\n",
       "M 1959 2075 \n",
       "Q 2384 2075 2632 2365 \n",
       "Q 2881 2656 2881 3163 \n",
       "Q 2881 3666 2632 3958 \n",
       "Q 2384 4250 1959 4250 \n",
       "Q 1534 4250 1286 3958 \n",
       "Q 1038 3666 1038 3163 \n",
       "Q 1038 2656 1286 2365 \n",
       "Q 1534 2075 1959 2075 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "      <path id=\"DejaVuSans-28\" d=\"M 1984 4856 \n",
       "Q 1566 4138 1362 3434 \n",
       "Q 1159 2731 1159 2009 \n",
       "Q 1159 1288 1364 580 \n",
       "Q 1569 -128 1984 -844 \n",
       "L 1484 -844 \n",
       "Q 1016 -109 783 600 \n",
       "Q 550 1309 550 2009 \n",
       "Q 550 2706 781 3412 \n",
       "Q 1013 4119 1484 4856 \n",
       "L 1984 4856 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "      <path id=\"DejaVuSans-40\" d=\"M 2381 1678 \n",
       "Q 2381 1231 2603 976 \n",
       "Q 2825 722 3213 722 \n",
       "Q 3597 722 3817 978 \n",
       "Q 4038 1234 4038 1678 \n",
       "Q 4038 2116 3813 2373 \n",
       "Q 3588 2631 3206 2631 \n",
       "Q 2828 2631 2604 2375 \n",
       "Q 2381 2119 2381 1678 \n",
       "z\n",
       "M 4084 744 \n",
       "Q 3897 503 3655 389 \n",
       "Q 3413 275 3091 275 \n",
       "Q 2553 275 2217 664 \n",
       "Q 1881 1053 1881 1678 \n",
       "Q 1881 2303 2218 2693 \n",
       "Q 2556 3084 3091 3084 \n",
       "Q 3413 3084 3656 2967 \n",
       "Q 3900 2850 4084 2613 \n",
       "L 4084 3022 \n",
       "L 4531 3022 \n",
       "L 4531 722 \n",
       "Q 4988 791 5245 1139 \n",
       "Q 5503 1488 5503 2041 \n",
       "Q 5503 2375 5404 2669 \n",
       "Q 5306 2963 5106 3213 \n",
       "Q 4781 3622 4314 3839 \n",
       "Q 3847 4056 3297 4056 \n",
       "Q 2913 4056 2559 3954 \n",
       "Q 2206 3853 1906 3653 \n",
       "Q 1416 3334 1139 2817 \n",
       "Q 863 2300 863 1697 \n",
       "Q 863 1200 1042 765 \n",
       "Q 1222 331 1563 0 \n",
       "Q 1891 -325 2322 -495 \n",
       "Q 2753 -666 3244 -666 \n",
       "Q 3647 -666 4036 -530 \n",
       "Q 4425 -394 4750 -141 \n",
       "L 5031 -488 \n",
       "Q 4641 -791 4180 -952 \n",
       "Q 3719 -1113 3244 -1113 \n",
       "Q 2666 -1113 2153 -908 \n",
       "Q 1641 -703 1241 -313 \n",
       "Q 841 78 631 592 \n",
       "Q 422 1106 422 1697 \n",
       "Q 422 2266 634 2781 \n",
       "Q 847 3297 1241 3688 \n",
       "Q 1644 4084 2172 4295 \n",
       "Q 2700 4506 3291 4506 \n",
       "Q 3953 4506 4520 4234 \n",
       "Q 5088 3963 5472 3463 \n",
       "Q 5706 3156 5829 2797 \n",
       "Q 5953 2438 5953 2053 \n",
       "Q 5953 1231 5456 756 \n",
       "Q 4959 281 4084 263 \n",
       "L 4084 744 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "      <path id=\"DejaVuSans-29\" d=\"M 513 4856 \n",
       "L 1013 4856 \n",
       "Q 1481 4119 1714 3412 \n",
       "Q 1947 2706 1947 2009 \n",
       "Q 1947 1309 1714 600 \n",
       "Q 1481 -109 1013 -844 \n",
       "L 513 -844 \n",
       "Q 928 -128 1133 580 \n",
       "Q 1338 1288 1338 2009 \n",
       "Q 1338 2731 1133 3434 \n",
       "Q 928 4138 513 4856 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "     </defs>\n",
       "     <use xlink:href=\"#DejaVuSans-62\"/>\n",
       "     <use xlink:href=\"#DejaVuSans-65\" x=\"63.476562\"/>\n",
       "     <use xlink:href=\"#DejaVuSans-73\" x=\"125\"/>\n",
       "     <use xlink:href=\"#DejaVuSans-74\" x=\"177.099609\"/>\n",
       "     <use xlink:href=\"#DejaVuSans-20\" x=\"216.308594\"/>\n",
       "     <use xlink:href=\"#DejaVuSans-76\" x=\"248.095703\"/>\n",
       "     <use xlink:href=\"#DejaVuSans-61\" x=\"307.275391\"/>\n",
       "     <use xlink:href=\"#DejaVuSans-6c\" x=\"368.554688\"/>\n",
       "     <use xlink:href=\"#DejaVuSans-5f\" x=\"396.337891\"/>\n",
       "     <use xlink:href=\"#DejaVuSans-6c\" x=\"446.337891\"/>\n",
       "     <use xlink:href=\"#DejaVuSans-6f\" x=\"474.121094\"/>\n",
       "     <use xlink:href=\"#DejaVuSans-73\" x=\"535.302734\"/>\n",
       "     <use xlink:href=\"#DejaVuSans-73\" x=\"587.402344\"/>\n",
       "     <use xlink:href=\"#DejaVuSans-3d\" x=\"639.501953\"/>\n",
       "     <use xlink:href=\"#DejaVuSans-30\" x=\"723.291016\"/>\n",
       "     <use xlink:href=\"#DejaVuSans-2e\" x=\"786.914062\"/>\n",
       "     <use xlink:href=\"#DejaVuSans-35\" x=\"818.701172\"/>\n",
       "     <use xlink:href=\"#DejaVuSans-37\" x=\"882.324219\"/>\n",
       "     <use xlink:href=\"#DejaVuSans-32\" x=\"945.947266\"/>\n",
       "     <use xlink:href=\"#DejaVuSans-39\" x=\"1009.570312\"/>\n",
       "     <use xlink:href=\"#DejaVuSans-20\" x=\"1073.193359\"/>\n",
       "     <use xlink:href=\"#DejaVuSans-28\" x=\"1104.980469\"/>\n",
       "     <use xlink:href=\"#DejaVuSans-40\" x=\"1143.994141\"/>\n",
       "     <use xlink:href=\"#DejaVuSans-65\" x=\"1243.994141\"/>\n",
       "     <use xlink:href=\"#DejaVuSans-70\" x=\"1305.517578\"/>\n",
       "     <use xlink:href=\"#DejaVuSans-6f\" x=\"1368.994141\"/>\n",
       "     <use xlink:href=\"#DejaVuSans-63\" x=\"1430.175781\"/>\n",
       "     <use xlink:href=\"#DejaVuSans-68\" x=\"1485.15625\"/>\n",
       "     <use xlink:href=\"#DejaVuSans-20\" x=\"1548.535156\"/>\n",
       "     <use xlink:href=\"#DejaVuSans-32\" x=\"1580.322266\"/>\n",
       "     <use xlink:href=\"#DejaVuSans-30\" x=\"1643.945312\"/>\n",
       "     <use xlink:href=\"#DejaVuSans-29\" x=\"1707.568359\"/>\n",
       "    </g>\n",
       "   </g>\n",
       "   <g id=\"legend_1\">\n",
       "    <g id=\"patch_7\">\n",
       "     <path d=\"M 291.990625 60.230625 \n",
       "L 371.58125 60.230625 \n",
       "Q 373.58125 60.230625 373.58125 58.230625 \n",
       "L 373.58125 29.318125 \n",
       "Q 373.58125 27.318125 371.58125 27.318125 \n",
       "L 291.990625 27.318125 \n",
       "Q 289.990625 27.318125 289.990625 29.318125 \n",
       "L 289.990625 58.230625 \n",
       "Q 289.990625 60.230625 291.990625 60.230625 \n",
       "z\n",
       "\" style=\"fill: #ffffff; opacity: 0.8; stroke: #cccccc; stroke-linejoin: miter\"/>\n",
       "    </g>\n",
       "    <g id=\"line2d_17\">\n",
       "     <path d=\"M 293.990625 35.416562 \n",
       "L 303.990625 35.416562 \n",
       "L 313.990625 35.416562 \n",
       "\" style=\"fill: none; stroke-dasharray: 5.55,2.4; stroke-dashoffset: 0; stroke: #0000ff; stroke-width: 1.5\"/>\n",
       "     <g>\n",
       "      <use xlink:href=\"#m9acc1b7416\" x=\"303.990625\" y=\"35.416562\" style=\"fill: #0000ff; stroke: #0000ff\"/>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"text_17\">\n",
       "     <!-- train_loss -->\n",
       "     <g transform=\"translate(321.990625 38.916562) scale(0.1 -0.1)\">\n",
       "      <defs>\n",
       "       <path id=\"DejaVuSans-72\" d=\"M 2631 2963 \n",
       "Q 2534 3019 2420 3045 \n",
       "Q 2306 3072 2169 3072 \n",
       "Q 1681 3072 1420 2755 \n",
       "Q 1159 2438 1159 1844 \n",
       "L 1159 0 \n",
       "L 581 0 \n",
       "L 581 3500 \n",
       "L 1159 3500 \n",
       "L 1159 2956 \n",
       "Q 1341 3275 1631 3429 \n",
       "Q 1922 3584 2338 3584 \n",
       "Q 2397 3584 2469 3576 \n",
       "Q 2541 3569 2628 3553 \n",
       "L 2631 2963 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       <path id=\"DejaVuSans-69\" d=\"M 603 3500 \n",
       "L 1178 3500 \n",
       "L 1178 0 \n",
       "L 603 0 \n",
       "L 603 3500 \n",
       "z\n",
       "M 603 4863 \n",
       "L 1178 4863 \n",
       "L 1178 4134 \n",
       "L 603 4134 \n",
       "L 603 4863 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "       <path id=\"DejaVuSans-6e\" d=\"M 3513 2113 \n",
       "L 3513 0 \n",
       "L 2938 0 \n",
       "L 2938 2094 \n",
       "Q 2938 2591 2744 2837 \n",
       "Q 2550 3084 2163 3084 \n",
       "Q 1697 3084 1428 2787 \n",
       "Q 1159 2491 1159 1978 \n",
       "L 1159 0 \n",
       "L 581 0 \n",
       "L 581 3500 \n",
       "L 1159 3500 \n",
       "L 1159 2956 \n",
       "Q 1366 3272 1645 3428 \n",
       "Q 1925 3584 2291 3584 \n",
       "Q 2894 3584 3203 3211 \n",
       "Q 3513 2838 3513 2113 \n",
       "z\n",
       "\" transform=\"scale(0.015625)\"/>\n",
       "      </defs>\n",
       "      <use xlink:href=\"#DejaVuSans-74\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-72\" x=\"39.208984\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-61\" x=\"80.322266\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-69\" x=\"141.601562\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-6e\" x=\"169.384766\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-5f\" x=\"232.763672\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-6c\" x=\"282.763672\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-6f\" x=\"310.546875\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-73\" x=\"371.728516\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-73\" x=\"423.828125\"/>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"line2d_18\">\n",
       "     <path d=\"M 293.990625 50.372812 \n",
       "L 303.990625 50.372812 \n",
       "L 313.990625 50.372812 \n",
       "\" style=\"fill: none; stroke: #00bfbf; stroke-width: 1.5; stroke-linecap: square\"/>\n",
       "     <g>\n",
       "      <use xlink:href=\"#m08f92ecf87\" x=\"303.990625\" y=\"50.372812\" style=\"fill: #00bfbf; stroke: #00bfbf\"/>\n",
       "     </g>\n",
       "    </g>\n",
       "    <g id=\"text_18\">\n",
       "     <!-- val_loss -->\n",
       "     <g transform=\"translate(321.990625 53.872812) scale(0.1 -0.1)\">\n",
       "      <use xlink:href=\"#DejaVuSans-76\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-61\" x=\"59.179688\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-6c\" x=\"120.458984\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-5f\" x=\"148.242188\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-6c\" x=\"198.242188\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-6f\" x=\"226.025391\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-73\" x=\"287.207031\"/>\n",
       "      <use xlink:href=\"#DejaVuSans-73\" x=\"339.306641\"/>\n",
       "     </g>\n",
       "    </g>\n",
       "   </g>\n",
       "  </g>\n",
       " </g>\n",
       "</svg>\n"
      ],
      "text/plain": [
       "<Figure size 600x400 with 1 Axes>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "\n",
       "<style>\n",
       "    /* background: */\n",
       "    progress::-webkit-progress-bar {background-color: #CDCDCD; width: 100%;}\n",
       "    progress {background-color: #CDCDCD;}\n",
       "\n",
       "    /* value: */\n",
       "    progress::-webkit-progress-value {background-color: #00BFFF  !important;}\n",
       "    progress::-moz-progress-bar {background-color: #00BFFF  !important;}\n",
       "    progress {color: #00BFFF ;}\n",
       "\n",
       "    /* optional */\n",
       "    .progress-bar-interrupted, .progress-bar-interrupted::-webkit-progress-bar {\n",
       "        background: #000000;\n",
       "    }\n",
       "</style>\n"
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "data": {
      "text/html": [
       "\n",
       "    <div>\n",
       "      <progress value='29' class='progress-bar-interrupted' max='100' style='width:300px; height:20px; vertical-align: middle;'></progress>\n",
       "      29.00% [29/100] [00:02<00:05]\n",
       "      <br>\n",
       "      ████████████████████100.00% [1/1] [val_loss=0.5729, val_mape=0.4934]\n",
       "    </div>\n",
       "    "
      ],
      "text/plain": [
       "<IPython.core.display.HTML object>"
      ]
     },
     "metadata": {},
     "output_type": "display_data"
    },
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\u001b[0;31m<<<<<< val_loss without improvement in 10 epoch,early stopping >>>>>> \n",
      "\u001b[0m\n"
     ]
    }
   ],
   "source": [
    "dfhistory = keras_model.fit(train_data=dl_train,\n",
    "            val_data=dl_val,\n",
    "            epochs=100,\n",
    "            ckpt_path='checkpoint',\n",
    "            patience=10,\n",
    "            monitor='val_loss',\n",
    "            mode='min',\n",
    "            callbacks=None,\n",
    "            plot=True,\n",
    "            cpu=True\n",
    "            )\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "792e4f1a",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "id": "ed66a496",
   "metadata": {},
   "source": [
    "### 四，评估模型"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "b51cbde5",
   "metadata": {},
   "source": [
    "评估模型一般要设置验证集或者测试集，由于此例数据较少，我们仅仅可视化损失函数在训练集上的迭代情况。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 53,
   "id": "46963c00",
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "100%|████████████████████████████████| 1/1 [00:00<00:00, 104.98it/s, val_loss=0.573, val_mape=0.493]\n"
     ]
    },
    {
     "data": {
      "text/plain": [
       "{'val_loss': 0.572850227355957, 'val_mape': 0.49335047602653503}"
      ]
     },
     "execution_count": 53,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "keras_model.evaluate(dl_val)\n"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "2687ac02",
   "metadata": {},
   "source": [
    "### 五，使用模型"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "59e0db6a",
   "metadata": {},
   "source": [
    "此处我们使用模型预测疫情结束时间，即 新增确诊病例为0 的时间。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 54,
   "id": "4164d6eb",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>confirmed_num</th>\n",
       "      <th>cured_num</th>\n",
       "      <th>dead_num</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>41</th>\n",
       "      <td>143.0</td>\n",
       "      <td>1681.0</td>\n",
       "      <td>30.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>42</th>\n",
       "      <td>99.0</td>\n",
       "      <td>1678.0</td>\n",
       "      <td>28.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>43</th>\n",
       "      <td>44.0</td>\n",
       "      <td>1661.0</td>\n",
       "      <td>27.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>44</th>\n",
       "      <td>40.0</td>\n",
       "      <td>1535.0</td>\n",
       "      <td>22.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>45</th>\n",
       "      <td>19.0</td>\n",
       "      <td>1297.0</td>\n",
       "      <td>17.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    confirmed_num  cured_num  dead_num\n",
       "41          143.0     1681.0      30.0\n",
       "42           99.0     1678.0      28.0\n",
       "43           44.0     1661.0      27.0\n",
       "44           40.0     1535.0      22.0\n",
       "45           19.0     1297.0      17.0"
      ]
     },
     "execution_count": 54,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "#使用dfresult记录现有数据以及此后预测的疫情数据\n",
    "dfresult = dfdiff[[\"confirmed_num\",\"cured_num\",\"dead_num\"]].copy()\n",
    "dfresult.tail()"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 55,
   "id": "727b7d0e",
   "metadata": {},
   "outputs": [],
   "source": [
    "#预测此后1000天的新增走势,将其结果添加到dfresult中\n",
    "for i in range(1000):\n",
    "    arr_input = torch.unsqueeze(torch.from_numpy(dfresult.values[-38:,:]),axis=0)\n",
    "    arr_predict = keras_model.forward(arr_input)\n",
    "\n",
    "    dfpredict = pd.DataFrame(torch.floor(arr_predict).data.numpy(),\n",
    "                columns = dfresult.columns)\n",
    "    dfresult = pd.concat([dfresult,dfpredict],ignore_index=True)\n",
    "    "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 56,
   "id": "d081b013",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>confirmed_num</th>\n",
       "      <th>cured_num</th>\n",
       "      <th>dead_num</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>62</th>\n",
       "      <td>0.0</td>\n",
       "      <td>659.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>63</th>\n",
       "      <td>0.0</td>\n",
       "      <td>633.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>64</th>\n",
       "      <td>0.0</td>\n",
       "      <td>608.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>65</th>\n",
       "      <td>0.0</td>\n",
       "      <td>584.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>66</th>\n",
       "      <td>0.0</td>\n",
       "      <td>561.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "    confirmed_num  cured_num  dead_num\n",
       "62            0.0      659.0       0.0\n",
       "63            0.0      633.0       0.0\n",
       "64            0.0      608.0       0.0\n",
       "65            0.0      584.0       0.0\n",
       "66            0.0      561.0       0.0"
      ]
     },
     "execution_count": 56,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dfresult.query(\"confirmed_num==0\").head()\n",
    "# 第62天开始新增确诊降为0\n",
    "# 注：该预测偏乐观\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "ad96908f",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "code",
   "execution_count": 57,
   "id": "cc5477ab",
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/html": [
       "<div>\n",
       "<style scoped>\n",
       "    .dataframe tbody tr th:only-of-type {\n",
       "        vertical-align: middle;\n",
       "    }\n",
       "\n",
       "    .dataframe tbody tr th {\n",
       "        vertical-align: top;\n",
       "    }\n",
       "\n",
       "    .dataframe thead th {\n",
       "        text-align: right;\n",
       "    }\n",
       "</style>\n",
       "<table border=\"1\" class=\"dataframe\">\n",
       "  <thead>\n",
       "    <tr style=\"text-align: right;\">\n",
       "      <th></th>\n",
       "      <th>confirmed_num</th>\n",
       "      <th>cured_num</th>\n",
       "      <th>dead_num</th>\n",
       "    </tr>\n",
       "  </thead>\n",
       "  <tbody>\n",
       "    <tr>\n",
       "      <th>160</th>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>161</th>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>162</th>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>163</th>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "    <tr>\n",
       "      <th>164</th>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "      <td>0.0</td>\n",
       "    </tr>\n",
       "  </tbody>\n",
       "</table>\n",
       "</div>"
      ],
      "text/plain": [
       "     confirmed_num  cured_num  dead_num\n",
       "160            0.0        0.0       0.0\n",
       "161            0.0        0.0       0.0\n",
       "162            0.0        0.0       0.0\n",
       "163            0.0        0.0       0.0\n",
       "164            0.0        0.0       0.0"
      ]
     },
     "execution_count": 57,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "dfresult.query(\"cured_num==0\").head()\n",
    "# 第160天开始新增治愈降为0.\n",
    "# 注: 该预测偏悲观，并且存在问题，如果将每天新增治愈人数加起来，将超过累计确诊人数。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "id": "da13d833",
   "metadata": {},
   "outputs": [],
   "source": []
  },
  {
   "cell_type": "markdown",
   "id": "ec4f9500",
   "metadata": {},
   "source": [
    "### 六，保存模型"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "9a78086b",
   "metadata": {},
   "source": [
    "模型权重保存在了model.ckpt_path路径。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 58,
   "id": "b3ad034a-63a5-42df-b65e-1cd4d7c543bf",
   "metadata": {},
   "outputs": [],
   "source": [
    "model.load_ckpt('checkpoint') #可以加载权重"
   ]
  },
  {
   "cell_type": "markdown",
   "id": "39cb303a",
   "metadata": {},
   "source": [
    "**如果本书对你有所帮助，想鼓励一下作者，记得给本项目加一颗星星star⭐️，并分享给你的朋友们喔😊!** \n",
    "\n",
    "如果对本书内容理解上有需要进一步和作者交流的地方，欢迎在公众号\"算法美食屋\"下留言。作者时间和精力有限，会酌情予以回复。\n",
    "\n",
    "也可以在公众号后台回复关键字：**加群**，加入读者交流群和大家讨论。\n",
    "\n",
    "![算法美食屋logo.png](https://tva1.sinaimg.cn/large/e6c9d24egy1h41m2zugguj20k00b9q46.jpg)"
   ]
  }
 ],
 "metadata": {
  "jupytext": {
   "cell_metadata_filter": "-all",
   "formats": "ipynb,md",
   "main_language": "python"
  },
  "kernelspec": {
   "display_name": "Python 3 (ipykernel)",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.10.14"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 5
}
